AWS Lambda 2015-03-31
- Client: Aws\Lambda\LambdaClient
- Service ID: lambda
- Version: 2015-03-31
This page describes the parameters and results for the operations of the AWS Lambda (2015-03-31), and shows how to use the Aws\Lambda\LambdaClient object to call the described operations. This documentation is specific to the 2015-03-31 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName'), where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */).
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */).
- AddLayerVersionPermission ( array $params = [] )
- Adds permissions to the resource-based policy of a version of an Lambda layer.
- AddPermission ( array $params = [] )
- Grants a principal permission to use a function.
- CheckpointDurableExecution ( array $params = [] )
- Saves the progress of a durable function execution during runtime.
- CreateAlias ( array $params = [] )
- Creates an alias for a Lambda Event Function version.
- CreateCapacityProvider ( array $params = [] )
- Creates a capacity provider that manages compute resources for Lambda Event Functions
- CreateCodeSigningConfig ( array $params = [] )
- Creates a code signing configuration.
- CreateEventSourceMapping ( array $params = [] )
- Creates a mapping between an event source and an Lambda Event Function.
- CreateFunction ( array $params = [] )
- Creates a Lambda Event Function.
- CreateFunctionUrlConfig ( array $params = [] )
- Creates a Lambda function URL with the specified configuration parameters.
- DeleteAlias ( array $params = [] )
- Deletes a Lambda Event Function alias.
- DeleteCapacityProvider ( array $params = [] )
- Deletes a capacity provider.
- DeleteCodeSigningConfig ( array $params = [] )
- Deletes the code signing configuration.
- DeleteDurableExecution ( array $params = [] )
- Deletes a completed Lambda durable execution and its data.
- DeleteEventSourceMapping ( array $params = [] )
- Deletes an event source mapping.
- DeleteFunction ( array $params = [] )
- Deletes a Lambda Event Function.
- DeleteFunctionCodeSigningConfig ( array $params = [] )
- Removes the code signing configuration from the function.
- DeleteFunctionConcurrency ( array $params = [] )
- Removes a concurrent execution limit from a Lambda Event Function.
- DeleteFunctionEventInvokeConfig ( array $params = [] )
- Deletes the configuration for asynchronous invocation for a function, version, or alias.
- DeleteFunctionUrlConfig ( array $params = [] )
- Deletes a Lambda function URL.
- DeleteLayerVersion ( array $params = [] )
- Deletes a version of an Lambda layer.
- DeleteProvisionedConcurrencyConfig ( array $params = [] )
- Deletes the provisioned concurrency configuration for a function.
- DeleteResourcePolicy ( array $params = [] )
- Deletes a resource-based policy from a Lambda resource.
- GetAccountSettings ( array $params = [] )
- Retrieves details about your account's limits and usage in an Amazon Web Services Region.
- GetAlias ( array $params = [] )
- Returns details about a Lambda Event Function alias.
- GetCapacityProvider ( array $params = [] )
- Retrieves information about a specific capacity provider, including its configuration, state, and associated resources.
- GetCodeSigningConfig ( array $params = [] )
- Returns information about the specified code signing configuration.
- GetDurableExecution ( array $params = [] )
- Retrieves detailed information about a specific durable execution, including its current status, input payload, result or error information, and execution metadata such as start time and usage statistics.
- GetDurableExecutionHistory ( array $params = [] )
- Retrieves the execution history for a durable execution, showing all the steps, callbacks, and events that occurred during the execution.
- GetDurableExecutionState ( array $params = [] )
- Retrieves the current execution state required for the replay process during durable function execution.
- GetEventSourceMapping ( array $params = [] )
- Returns details about an event source mapping.
- GetFunction ( array $params = [] )
- Returns information about a Lambda Event Function or function version, with a link to download the deployment package that's valid for 10 minutes.
- GetFunctionCodeSigningConfig ( array $params = [] )
- Returns the code signing configuration for the specified function.
- GetFunctionConcurrency ( array $params = [] )
- Returns details about the reserved concurrency configuration for a function.
- GetFunctionConfiguration ( array $params = [] )
- Returns the version-specific settings of a Lambda Event Function or version.
- GetFunctionEventInvokeConfig ( array $params = [] )
- Retrieves the configuration for asynchronous invocation for a function, version, or alias.
- GetFunctionRecursionConfig ( array $params = [] )
- Returns your function's recursive loop detection configuration.
- GetFunctionScalingConfig ( array $params = [] )
- Retrieves the scaling configuration for a Lambda Managed Instances function.
- GetFunctionUrlConfig ( array $params = [] )
- Returns details about a Lambda function URL.
- GetLayerVersion ( array $params = [] )
- Returns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes.
- GetLayerVersionByArn ( array $params = [] )
- Returns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes.
- GetLayerVersionPolicy ( array $params = [] )
- Returns the permission policy for a version of an Lambda layer.
- GetPolicy ( array $params = [] )
- Returns the resource-based IAM policy for a function, version, or alias.
- GetProvisionedConcurrencyConfig ( array $params = [] )
- Retrieves the provisioned concurrency configuration for a function's alias or version.
- GetResourcePolicy ( array $params = [] )
- Retrieves the resource-based policy attached to a Lambda resource.
- GetRuntimeManagementConfig ( array $params = [] )
- Retrieves the runtime management configuration for a function's version.
- Invoke ( array $params = [] )
- Invokes a Lambda Event Function.
- InvokeAsynchronous ( array $params = [] )
- For asynchronous function invocation, use Invoke.
- InvokeWithResponseStream ( array $params = [] )
- Configure your Lambda Event Functions to stream response payloads back to clients.
- ListAliases ( array $params = [] )
- Returns a list of aliases for a Lambda Event Function.
- ListCapacityProviders ( array $params = [] )
- Returns a list of capacity providers in your account.
- ListCodeSigningConfigs ( array $params = [] )
- Returns a list of code signing configurations.
- ListDurableExecutionsByFunction ( array $params = [] )
- Returns a list of durable executions for a specified Lambda function.
- ListEventSourceMappings ( array $params = [] )
- Lists event source mappings.
- ListFunctionEventInvokeConfigs ( array $params = [] )
- Retrieves a list of configurations for asynchronous invocation for a Lambda Event Function.
- ListFunctionUrlConfigs ( array $params = [] )
- Returns a list of Lambda function URLs for the specified function.
- ListFunctionVersionsByCapacityProvider ( array $params = [] )
- Returns a list of function versions that are configured to use a specific capacity provider.
- ListFunctions ( array $params = [] )
- Returns a list of Lambda Event Functions, with the version-specific configuration of each.
- ListFunctionsByCodeSigningConfig ( array $params = [] )
- List the functions that use the specified code signing configuration.
- ListLayerVersions ( array $params = [] )
- Lists the versions of an Lambda layer.
- ListLayers ( array $params = [] )
- Lists Lambda layers and shows information about the latest version of each.
- ListProvisionedConcurrencyConfigs ( array $params = [] )
- Retrieves a list of provisioned concurrency configurations for a function.
- ListTags ( array $params = [] )
- Returns a function, event source mapping, or code signing configuration's tags.
- ListVersionsByFunction ( array $params = [] )
- Returns a list of versions of a Lambda Event Function, with the version-specific configuration of each.
- PauseDurableExecution ( array $params = [] )
- Pauses a running durable execution.
- PublishLayerVersion ( array $params = [] )
- Creates an Lambda layer from a ZIP archive.
- PublishVersion ( array $params = [] )
- Creates a version from the current code and configuration of a Lambda Event Function.
- PutFunctionCodeSigningConfig ( array $params = [] )
- Update the code signing configuration for the function.
- PutFunctionConcurrency ( array $params = [] )
- Sets the maximum number of simultaneous executions for a Lambda Event Function, and reserves capacity for that concurrency level.
- PutFunctionEventInvokeConfig ( array $params = [] )
- Configures options for asynchronous invocation on a function, version, or alias.
- PutFunctionRecursionConfig ( array $params = [] )
- Sets the recursive loop detection configuration for a Lambda Event Function.
- PutFunctionScalingConfig ( array $params = [] )
- Sets the scaling configuration for a Lambda Managed Instances function.
- PutProvisionedConcurrencyConfig ( array $params = [] )
- Adds a provisioned concurrency configuration to a function's alias or version.
- PutResourcePolicy ( array $params = [] )
- Adds a resource-based policy to a Lambda resource.
- PutRuntimeManagementConfig ( array $params = [] )
- Sets the runtime management configuration for a function's version.
- RemoveLayerVersionPermission ( array $params = [] )
- Removes a statement from the permissions policy for a version of an Lambda layer.
- RemovePermission ( array $params = [] )
- Revokes function-use permission from an Amazon Web Services service or another Amazon Web Services account.
- ResumeDurableExecution ( array $params = [] )
- Resumes a paused durable execution.
- SendDurableExecutionCallbackFailure ( array $params = [] )
- Sends a failure response for a callback operation in a durable execution.
- SendDurableExecutionCallbackHeartbeat ( array $params = [] )
- Sends a heartbeat signal for a long-running callback operation to prevent timeout.
- SendDurableExecutionCallbackSuccess ( array $params = [] )
- Sends a successful completion response for a callback operation in a durable execution.
- StopDurableExecution ( array $params = [] )
- Stops a running or paused durable execution.
- TagResource ( array $params = [] )
- Adds tags to a function, event source mapping, or code signing configuration.
- UntagResource ( array $params = [] )
- Removes tags from a function, event source mapping, or code signing configuration.
- UpdateAlias ( array $params = [] )
- Updates the configuration of a Lambda Event Function alias.
- UpdateCapacityProvider ( array $params = [] )
- Updates the configuration of an existing capacity provider.
- UpdateCodeSigningConfig ( array $params = [] )
- Update the code signing configuration.
- UpdateEventSourceMapping ( array $params = [] )
- Updates an event source mapping.
- UpdateFunctionCode ( array $params = [] )
- Updates a Lambda Event Function's code.
- UpdateFunctionConfiguration ( array $params = [] )
- Modifies the version-specific settings of a Lambda Event Function.
- UpdateFunctionEventInvokeConfig ( array $params = [] )
- Updates the configuration for asynchronous invocation for a function, version, or alias.
- UpdateFunctionUrlConfig ( array $params = [] )
- Updates the configuration for a function URL of a Lambda Event Function.
Paginators
Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:
- GetDurableExecutionHistory
- GetDurableExecutionState
- ListAliases
- ListCapacityProviders
- ListCodeSigningConfigs
- ListDurableExecutionsByFunction
- ListEventSourceMappings
- ListFunctionEventInvokeConfigs
- ListFunctionUrlConfigs
- ListFunctionVersionsByCapacityProvider
- ListFunctions
- ListFunctionsByCodeSigningConfig
- ListLayerVersions
- ListLayers
- ListProvisionedConcurrencyConfigs
- ListVersionsByFunction
Waiters
Waiters allow you to poll a resource until it enters into a desired state. A waiter has a name used to describe what it does, and is associated with an API operation. When creating a waiter, you can provide the API operation parameters associated with the corresponding operation. Waiters can be accessed using the getWaiter($waiterName, $operationParameters) method of a client object. This client supports the following waiters:
| Waiter name | API Operation | Delay | Max Attempts |
|---|---|---|---|
| FunctionActive | GetFunctionConfiguration | 5 | 60 |
| FunctionActiveV2 | GetFunction | 1 | 300 |
| FunctionExists | GetFunction | 1 | 20 |
| FunctionUpdated | GetFunctionConfiguration | 5 | 60 |
| FunctionUpdatedV2 | GetFunction | 1 | 300 |
| PublishedVersionActive | GetFunctionConfiguration | 5 | 312 |
Operations
AddLayerVersionPermission
$result = $client->addLayerVersionPermission([/* ... */]); $promise = $client->addLayerVersionPermissionAsync([/* ... */]);
Adds permissions to the resource-based policy of a version of an Lambda layer. Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all accounts in an organization, or all Amazon Web Services accounts.
To revoke permission, call RemoveLayerVersionPermission with the statement ID that you specified when you added it.
Parameter Syntax
$result = $client->addLayerVersionPermission([
'Action' => '<string>', // REQUIRED
'LayerName' => '<string>', // REQUIRED
'OrganizationId' => '<string>',
'Principal' => '<string>', // REQUIRED
'RevisionId' => '<string>',
'StatementId' => '<string>', // REQUIRED
'VersionNumber' => <integer>, // REQUIRED
]);
Parameter Details
Members
- Action
-
- Required: Yes
- Type: string
The API action that grants access to the layer. For example,
lambda:GetLayerVersion. - LayerName
-
- Required: Yes
- Type: string
The name or Amazon Resource Name (ARN) of the layer.
- OrganizationId
-
- Type: string
With the principal set to
*, grant permission to all accounts in the specified organization. - Principal
-
- Required: Yes
- Type: string
An account ID, or
*to grant layer usage permission to all accounts in an organization, or all Amazon Web Services accounts (iforganizationIdis not specified). For the last case, make sure that you really do want all Amazon Web Services accounts to have usage permission to this layer. - RevisionId
-
- Type: string
Only update the policy if the revision ID matches the ID specified. Use this option to avoid modifying a policy that has changed since you last read it.
- StatementId
-
- Required: Yes
- Type: string
An identifier that distinguishes the policy from others on the same layer version.
- VersionNumber
-
- Required: Yes
- Type: long (int|float)
The version number.
Result Syntax
[
'RevisionId' => '<string>',
'Statement' => '<string>',
]
Result Details
Members
- RevisionId
-
- Type: string
A unique identifier for the current revision of the policy.
- Statement
-
- Type: string
The permission statement.
Errors
- InvalidParameterValueException:
One of the parameters in the request is not valid.
- ResourceConflictException:
The resource already exists, or another operation is in progress.
- ServiceException:
The Lambda service encountered an internal error.
- TooManyRequestsException:
The request throughput limit was exceeded. For more information, see Lambda quotas.
- PolicyLengthExceededException:
The permissions policy for the resource is too large. For more information, see Lambda quotas.
- ResourceNotFoundException:
The resource specified in the request does not exist.
- PreconditionFailedException:
The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.
-
For AddPermission and RemovePermission API operations: Call
GetPolicyto retrieve the latest RevisionId for your resource. -
For all other API operations: Call
GetFunctionorGetAliasto retrieve the latest RevisionId for your resource.
-
Examples
Example 1: To add permissions to a layer version
The following example grants permission for the account 223456789012 to use version 1 of a layer named my-layer.
$result = $client->addLayerVersionPermission([
'Action' => 'lambda:GetLayerVersion',
'LayerName' => 'my-layer',
'Principal' => '223456789012',
'StatementId' => 'xaccount',
'VersionNumber' => 1,
]);
Result syntax:
[
'RevisionId' => '35d87451-f796-4a3f-a618-95a3671b0a0c',
'Statement' => '{"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::223456789012:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:my-layer:1"}',
]
AddPermission
$result = $client->addPermission([/* ... */]); $promise = $client->addPermissionAsync([/* ... */]);
Grants a principal permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name (ARN) of that version or alias to invoke the function. Note: Lambda does not support adding policies to version $LATEST.
To grant permission to another account, specify the account ID as the Principal. To grant permission to an organization defined in Organizations, specify the organization ID as the PrincipalOrgID. For Amazon Web Services services, the principal is a domain-style identifier that the service defines, such as s3.amazonaws.com or sns.amazonaws.com. For Amazon Web Services services, you can also specify the ARN of the associated resource as the SourceArn. If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function.
This operation adds a statement to a resource-based permissions policy for the function. For more information about function policies, see Using resource-based policies for Lambda.
Parameter Syntax
$result = $client->addPermission([
'Action' => '<string>', // REQUIRED
'EventSourceToken' => '<string>',
'FunctionName' => '<string>', // REQUIRED
'FunctionUrlAuthType' => 'NONE|AWS_IAM',
'InvokedViaFunctionUrl' => true || false,
'Principal' => '<string>', // REQUIRED
'PrincipalOrgID' => '<string>',
'Qualifier' => '<string>',
'RevisionId' => '<string>',
'SourceAccount' => '<string>',
'SourceArn' => '<string>',
'StatementId' => '<string>', // REQUIRED
]);
Parameter Details
Members
- Action
-
- Required: Yes
- Type: string
The action that the principal can use on the function. For example,
lambda:InvokeFunctionorlambda:GetFunction. - EventSourceToken
-
- Type: string
For Alexa Smart Home functions, a token that the invoker must supply.
- FunctionName
-
- Required: Yes
- Type: string
The name or ARN of the Lambda function, version, or alias.
Name formats
-
Function name –
my-function(name-only),my-function:v1(with alias). -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function. -
Partial ARN –
123456789012:function:my-function.
You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- FunctionUrlAuthType
-
- Type: string
The type of authentication that your function URL uses. Set to
AWS_IAMif you want to restrict access to authenticated users only. Set toNONEif you want to bypass IAM authentication to create a public endpoint. For more information, see Control access to Lambda function URLs. - InvokedViaFunctionUrl
-
- Type: boolean
Indicates whether the permission applies when the function is invoked through a function URL.
- Principal
-
- Required: Yes
- Type: string
The Amazon Web Services service, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a service, use
SourceArnorSourceAccountto limit who can invoke the function through that service. - PrincipalOrgID
-
- Type: string
The identifier for your organization in Organizations. Use this to grant permissions to all the Amazon Web Services accounts under this organization.
- Qualifier
-
- Type: string
Specify a version or alias to add permissions to a published version of the function.
- RevisionId
-
- Type: string
Update the policy only if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.
- SourceAccount
-
- Type: string
For Amazon Web Services service, the ID of the Amazon Web Services account that owns the resource. Use this together with
SourceArnto ensure that the specified account owns the resource. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account. - SourceArn
-
- Type: string
For Amazon Web Services services, the ARN of the Amazon Web Services resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic.
Note that Lambda configures the comparison using the
StringLikeoperator. - StatementId
-
- Required: Yes
- Type: string
A statement identifier that differentiates the statement from others in the same policy.
Result Syntax
[
'Statement' => '<string>',
]
Result Details
Members
- Statement
-
- Type: string
The permission statement that's added to the function policy.
Errors
- InvalidParameterValueException:
One of the parameters in the request is not valid.
- ResourceConflictException:
The resource already exists, or another operation is in progress.
- PublicPolicyException:
The resource-based policy you tried to add to the Lambda resource would grant public access to it, which isn't allowed.
- ServiceException:
The Lambda service encountered an internal error.
- TooManyRequestsException:
The request throughput limit was exceeded. For more information, see Lambda quotas.
- PolicyLengthExceededException:
The permissions policy for the resource is too large. For more information, see Lambda quotas.
- ResourceNotFoundException:
The resource specified in the request does not exist.
- PreconditionFailedException:
The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.
-
For AddPermission and RemovePermission API operations: Call
GetPolicyto retrieve the latest RevisionId for your resource. -
For all other API operations: Call
GetFunctionorGetAliasto retrieve the latest RevisionId for your resource.
-
Examples
Example 1: To grant Amazon S3 permission to invoke a function
The following example adds permission for Amazon S3 to invoke a Lambda function named my-function for notifications from a bucket named my-bucket-1xpuxmplzrlbh in account 123456789012.
$result = $client->addPermission([
'Action' => 'lambda:InvokeFunction',
'FunctionName' => 'my-function',
'Principal' => 's3.amazonaws.com',
'SourceAccount' => '123456789012',
'SourceArn' => 'arn:aws:s3:::my-bucket-1xpuxmplzrlbh/*',
'StatementId' => 's3',
]);
Result syntax:
[
'Statement' => '{"Sid":"s3","Effect":"Allow","Principal":{"Service":"s3.amazonaws.com"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function","Condition":{"StringEquals":{"AWS:SourceAccount":"123456789012"},"ArnLike":{"AWS:SourceArn":"arn:aws:s3:::my-bucket-1xpuxmplzrlbh"}}}',
]
Example 2: To grant another account permission to invoke a function
The following example adds permission for account 223456789012 invoke a Lambda function named my-function.
$result = $client->addPermission([
'Action' => 'lambda:InvokeFunction',
'FunctionName' => 'my-function',
'Principal' => '223456789012',
'StatementId' => 'xaccount',
]);
Result syntax:
[
'Statement' => '{"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::223456789012:root"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function"}',
]
CheckpointDurableExecution
$result = $client->checkpointDurableExecution([/* ... */]); $promise = $client->checkpointDurableExecutionAsync([/* ... */]);
Saves the progress of a durable function execution during runtime. This API is used by the Lambda durable functions SDK to checkpoint completed steps and schedule asynchronous operations. You typically don't need to call this API directly as the SDK handles checkpointing automatically.
Each checkpoint operation consumes the current checkpoint token and returns a new one for the next checkpoint. This ensures that checkpoints are applied in the correct order and prevents duplicate or out-of-order state updates.
Parameter Syntax
$result = $client->checkpointDurableExecution([
'CheckpointToken' => '<string>', // REQUIRED
'ClientToken' => '<string>',
'DurableExecutionArn' => '<string>', // REQUIRED
'Updates' => [
[
'Action' => 'START|SUCCEED|FAIL|RETRY|CANCEL', // REQUIRED
'CallbackOptions' => [
'HeartbeatTimeoutSeconds' => <integer>,
'TimeoutSeconds' => <integer>,
],
'ChainedInvokeOptions' => [
'FunctionName' => '<string>', // REQUIRED
'TenantId' => '<string>',
'XAmznTraceId' => '<string>',
],
'ContextOptions' => [
'ReplayChildren' => true || false,
],
'Error' => [
'ErrorData' => '<string>',
'ErrorMessage' => '<string>',
'ErrorType' => '<string>',
'StackTrace' => ['<string>', ...],
],
'Id' => '<string>', // REQUIRED
'Name' => '<string>',
'ParentId' => '<string>',
'Payload' => '<string>',
'StepOptions' => [
'NextAttemptDelaySeconds' => <integer>,
],
'SubType' => '<string>',
'Type' => 'EXECUTION|CONTEXT|STEP|WAIT|CALLBACK|CHAINED_INVOKE', // REQUIRED
'WaitOptions' => [
'WaitSeconds' => <integer>,
],
],
// ...
],
]);
Parameter Details
Members
- CheckpointToken
-
- Required: Yes
- Type: string
A unique token that identifies the current checkpoint state. This token is provided by the Lambda runtime and must be used to ensure checkpoints are applied in the correct order. Each checkpoint operation consumes this token and returns a new one.
- ClientToken
-
- Type: string
An optional idempotency token to ensure that duplicate checkpoint requests are handled correctly. If provided, Lambda uses this token to detect and handle duplicate requests within a 15-minute window.
- DurableExecutionArn
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the durable execution.
- Updates
-
- Type: Array of OperationUpdate structures
An array of state updates to apply during this checkpoint. Each update represents a change to the execution state, such as completing a step, starting a callback, or scheduling a timer. Updates are applied atomically as part of the checkpoint operation.
Result Syntax
[
'CheckpointToken' => '<string>',
'NewExecutionState' => [
'NextMarker' => '<string>',
'Operations' => [
[
'CallbackDetails' => [
'CallbackId' => '<string>',
'Error' => [
'ErrorData' => '<string>',
'ErrorMessage' => '<string>',
'ErrorType' => '<string>',
'StackTrace' => ['<string>', ...],
],
'Result' => '<string>',
],
'ChainedInvokeDetails' => [
'Error' => [
'ErrorData' => '<string>',
'ErrorMessage' => '<string>',
'ErrorType' => '<string>',
'StackTrace' => ['<string>', ...],
],
'Result' => '<string>',
],
'ContextDetails' => [
'Error' => [
'ErrorData' => '<string>',
'ErrorMessage' => '<string>',
'ErrorType' => '<string>',
'StackTrace' => ['<string>', ...],
],
'ReplayChildren' => true || false,
'Result' => '<string>',
],
'EndTimestamp' => <DateTime>,
'ExecutionDetails' => [
'InputPayload' => '<string>',
],
'Id' => '<string>',
'Name' => '<string>',
'ParentId' => '<string>',
'StartTimestamp' => <DateTime>,
'Status' => 'STARTED|PENDING|READY|SUCCEEDED|FAILED|CANCELLED|TIMED_OUT|STOPPED',
'StepDetails' => [
'Attempt' => <integer>,
'Error' => [
'ErrorData' => '<string>',
'ErrorMessage' => '<string>',
'ErrorType' => '<string>',
'StackTrace' => ['<string>', ...],
],
'NextAttemptTimestamp' => <DateTime>,
'Result' => '<string>',
],
'SubType' => '<string>',
'Type' => 'EXECUTION|CONTEXT|STEP|WAIT|CALLBACK|CHAINED_INVOKE',
'WaitDetails' => [
'ScheduledEndTimestamp' => <DateTime>,
],
],
// ...
],
],
]
Result Details
Members
- CheckpointToken
-
- Type: string
A new checkpoint token to use for the next checkpoint operation. This token replaces the one provided in the request and must be used for subsequent checkpoints to maintain proper ordering.
- NewExecutionState
-
- Required: Yes
- Type: CheckpointUpdatedExecutionState structure
Updated execution state information that includes any changes that occurred since the last checkpoint, such as completed callbacks or expired timers. This allows the SDK to update its internal state during replay.
Errors
- InvalidParameterValueException:
One of the parameters in the request is not valid.
- KMSInvalidStateException:
Lambda couldn't decrypt the environment variables because the state of the KMS key used is not valid for Decrypt. Check the function's KMS key settings.
- ServiceException:
The Lambda service encountered an internal error.
- TooManyRequestsException:
The request throughput limit was exceeded. For more information, see Lambda quotas.
- KMSNotFoundException:
Lambda couldn't decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.
- KMSAccessDeniedException:
Lambda couldn't decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.
- KMSDisabledException:
Lambda couldn't decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.
CreateAlias
$result = $client->createAlias([/* ... */]); $promise = $client->createAliasAsync([/* ... */]);
Creates an alias for a Lambda Event Function version. Use aliases to provide clients with a function identifier that you can update to invoke a different version.
You can also map an alias to split invocation requests between two versions. Use the RoutingConfig parameter to specify a second version and the percentage of invocation requests that it receives.
Parameter Syntax
$result = $client->createAlias([
'Description' => '<string>',
'FunctionName' => '<string>', // REQUIRED
'FunctionVersion' => '<string>', // REQUIRED
'Name' => '<string>', // REQUIRED
'RoutingConfig' => [
'AdditionalVersionWeights' => [<float>, ...],
],
]);
Parameter Details
Members
- Description
-
- Type: string
A description of the alias.
- FunctionName
-
- Required: Yes
- Type: string
The name or ARN of the Lambda function.
Name formats
-
Function name -
MyFunction. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction. -
Partial ARN -
123456789012:function:MyFunction.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- FunctionVersion
-
- Required: Yes
- Type: string
The function version that the alias invokes.
- Name
-
- Required: Yes
- Type: string
The name of the alias.
- RoutingConfig
-
- Type: AliasRoutingConfiguration structure
The routing configuration of the alias.
Result Syntax
[
'AliasArn' => '<string>',
'Description' => '<string>',
'FunctionVersion' => '<string>',
'Name' => '<string>',
'RevisionId' => '<string>',
'RoutingConfig' => [
'AdditionalVersionWeights' => [<float>, ...],
],
]
Result Details
Members
- AliasArn
-
- Type: string
The Amazon Resource Name (ARN) of the alias.
- Description
-
- Type: string
A description of the alias.
- FunctionVersion
-
- Type: string
The function version that the alias invokes.
- Name
-
- Type: string
The name of the alias.
- RevisionId
-
- Type: string
A unique identifier that changes when you update the alias.
- RoutingConfig
-
- Type: AliasRoutingConfiguration structure
The routing configuration of the alias.
Errors
- InvalidParameterValueException:
One of the parameters in the request is not valid.
- ResourceConflictException:
The resource already exists, or another operation is in progress.
- ServiceException:
The Lambda service encountered an internal error.
- TooManyRequestsException:
The request throughput limit was exceeded. For more information, see Lambda quotas.
- AliasLimitExceededException:
Lambda couldn't create the alias because your Amazon Web Services account has exceeded the maximum number of aliases allowed per Lambda function. For more information, see Lambda quotas.
- ResourceNotFoundException:
The resource specified in the request does not exist.
Examples
Example 1: To create an alias for a Lambda function
The following example creates an alias named LIVE that points to version 1 of the my-function Lambda function.
$result = $client->createAlias([
'Description' => 'alias for live version of function',
'FunctionName' => 'my-function',
'FunctionVersion' => '1',
'Name' => 'LIVE',
]);
Result syntax:
[
'AliasArn' => 'arn:aws:lambda:us-east-2:123456789012:function:my-function:LIVE',
'Description' => 'alias for live version of function',
'FunctionVersion' => '1',
'Name' => 'LIVE',
'RevisionId' => '873282ed-xmpl-4dc8-a069-d0c647e470c6',
]
CreateCapacityProvider
$result = $client->createCapacityProvider([/* ... */]); $promise = $client->createCapacityProviderAsync([/* ... */]);
Creates a capacity provider that manages compute resources for Lambda Event Functions
Parameter Syntax
$result = $client->createCapacityProvider([
'CapacityProviderName' => '<string>', // REQUIRED
'CapacityProviderScalingConfig' => [
'MaxVCpuCount' => <integer>,
'ScalingMode' => 'Auto|Manual',
'ScalingPolicies' => [
[
'PredefinedMetricType' => 'LambdaCapacityProviderAverageCPUUtilization|LambdaCapacityProviderAverageGPUUtilization', // REQUIRED
'TargetValue' => <float>, // REQUIRED
],
// ...
],
],
'InstanceRequirements' => [
'AllowedInstanceTypes' => ['<string>', ...],
'Architectures' => ['<string>', ...],
'ExcludedInstanceTypes' => ['<string>', ...],
],
'KmsKeyArn' => '<string>',
'PermissionsConfig' => [ // REQUIRED
'CapacityProviderOperatorRoleArn' => '<string>', // REQUIRED
],
'PropagateTags' => [
'ExplicitTags' => ['<string>', ...],
'Mode' => 'None|Explicit',
],
'Tags' => ['<string>', ...],
'TelemetryConfig' => [
'LoggingConfig' => [
'LogGroup' => '<string>',
'SystemLogLevel' => 'DEBUG|INFO|WARN',
],
],
'VpcConfig' => [ // REQUIRED
'SecurityGroupIds' => ['<string>', ...], // REQUIRED
'SubnetIds' => ['<string>', ...], // REQUIRED
],
]);
Parameter Details
Members
- CapacityProviderName
-
- Required: Yes
- Type: string
The name of the capacity provider.
- CapacityProviderScalingConfig
-
- Type: CapacityProviderScalingConfig structure
The scaling configuration that defines how the capacity provider scales compute instances, including maximum vCPU count and scaling policies.
- InstanceRequirements
-
- Type: InstanceRequirements structure
The instance requirements that specify the compute instance characteristics, including architectures and allowed or excluded instance types.
- KmsKeyArn
-
- Type: string
The ARN of the KMS key used to encrypt data associated with the capacity provider.
- PermissionsConfig
-
- Required: Yes
- Type: CapacityProviderPermissionsConfig structure
The permissions configuration that specifies the IAM role ARN used by the capacity provider to manage compute resources.
- PropagateTags
-
- Type: PropagateTags structure
The tag propagation configuration for the capacity provider. Specifies tags to apply to managed resources at launch.
- Tags
-
- Type: Associative array of custom strings keys (TagKey) to strings
A list of tags to associate with the capacity provider.
- TelemetryConfig
-
- Type: CapacityProviderTelemetryConfig structure
The telemetry configuration for the capacity provider. Specifies logging settings for managed resources.
- VpcConfig
-
- Required: Yes
- Type: CapacityProviderVpcConfig structure
The VPC configuration for the capacity provider, including subnet IDs and security group IDs where compute instances will be launched.
Result Syntax
[
'CapacityProvider' => [
'CapacityProviderArn' => '<string>',
'CapacityProviderScalingConfig' => [
'MaxVCpuCount' => <integer>,
'ScalingMode' => 'Auto|Manual',
'ScalingPolicies' => [
[
'PredefinedMetricType' => 'LambdaCapacityProviderAverageCPUUtilization|LambdaCapacityProviderAverageGPUUtilization',
'TargetValue' => <float>,
],
// ...
],
],
'InstanceRequirements' => [
'AllowedInstanceTypes' => ['<string>', ...],
'Architectures' => ['<string>', ...],
'ExcludedInstanceTypes' => ['<string>', ...],
],
'KmsKeyArn' => '<string>',
'LastModified' => '<string>',
'PermissionsConfig' => [
'CapacityProviderOperatorRoleArn' => '<string>',
],
'PropagateTags' => [
'ExplicitTags' => ['<string>', ...],
'Mode' => 'None|Explicit',
],
'State' => 'Pending|Active|Failed|Deleting',
'TelemetryConfig' => [
'LoggingConfig' => [
'LogGroup' => '<string>',
'SystemLogLevel' => 'DEBUG|INFO|WARN',
],
],
'VpcConfig' => [
'SecurityGroupIds' => ['<string>', ...],
'SubnetIds' => ['<string>', ...],
],
],
]
Result Details
Members
- CapacityProvider
-
- Required: Yes
- Type: CapacityProvider structure
Information about the capacity provider that was created.
Errors
- InvalidParameterValueException:
One of the parameters in the request is not valid.
- ResourceConflictException:
The resource already exists, or another operation is in progress.
- ServiceException:
The Lambda service encountered an internal error.
- TooManyRequestsException:
The request throughput limit was exceeded. For more information, see Lambda quotas.
- CapacityProviderLimitExceededException:
The maximum number of capacity providers for your account has been exceeded. For more information, see Lambda quotas
CreateCodeSigningConfig
$result = $client->createCodeSigningConfig([/* ... */]); $promise = $client->createCodeSigningConfigAsync([/* ... */]);
Creates a code signing configuration. A code signing configuration defines a list of allowed signing profiles and defines the code-signing validation policy (action to be taken if deployment validation checks fail).
Parameter Syntax
$result = $client->createCodeSigningConfig([
'AllowedPublishers' => [ // REQUIRED
'SigningProfileVersionArns' => ['<string>', ...], // REQUIRED
],
'CodeSigningPolicies' => [
'UntrustedArtifactOnDeployment' => 'Warn|Enforce',
],
'Description' => '<string>',
'Tags' => ['<string>', ...],
]);
Parameter Details
Members
- AllowedPublishers
-
- Required: Yes
- Type: AllowedPublishers structure
Signing profiles for this code signing configuration.
- CodeSigningPolicies
-
- Type: CodeSigningPolicies structure
The code signing policies define the actions to take if the validation checks fail.
- Description
-
- Type: string
Descriptive name for this code signing configuration.
- Tags
-
- Type: Associative array of custom strings keys (TagKey) to strings
A list of tags to add to the code signing configuration.
Result Syntax
[
'CodeSigningConfig' => [
'AllowedPublishers' => [
'SigningProfileVersionArns' => ['<string>', ...],
],
'CodeSigningConfigArn' => '<string>',
'CodeSigningConfigId' => '<string>',
'CodeSigningPolicies' => [
'UntrustedArtifactOnDeployment' => 'Warn|Enforce',
],
'Description' => '<string>',
'LastModified' => '<string>',
],
]
Result Details
Members
- CodeSigningConfig
-
- Required: Yes
- Type: CodeSigningConfig structure
The code signing configuration.
Errors
- InvalidParameterValueException:
One of the parameters in the request is not valid.
- ServiceException:
The Lambda service encountered an internal error.
CreateEventSourceMapping
$result = $client->createEventSourceMapping([/* ... */]); $promise = $client->createEventSourceMappingAsync([/* ... */]);
Creates a mapping between an event source and an Lambda Event Function. Lambda reads items from the event source and invokes the function.
For details about how to configure different event sources, see the following topics.
The following error handling options are available for stream sources (DynamoDB, Kinesis, Amazon MSK, and self-managed Apache Kafka):
-
BisectBatchOnFunctionError– If the function returns an error, split the batch in two and retry. -
MaximumRecordAgeInSeconds– Discard records older than the specified age. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires -
MaximumRetryAttempts– Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires. -
OnFailure– Send discarded records to an Amazon SQS queue, Amazon SNS topic, Kafka topic, or Amazon S3 bucket. For more information, see Adding a destination.
The following option is available only for DynamoDB and Kinesis event sources:
-
ParallelizationFactor– Process multiple batches from each shard concurrently.
For information about which configuration parameters apply to each event source, see the following topics.
Parameter Syntax
$result = $client->createEventSourceMapping([
'AmazonManagedKafkaEventSourceConfig' => [
'ConsumerGroupId' => '<string>',
'SchemaRegistryConfig' => [
'AccessConfigs' => [
[
'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE|OAUTHBEARER_AUTH',
'URI' => '<string>',
],
// ...
],
'EventRecordFormat' => 'JSON|SOURCE',
'SchemaRegistryURI' => '<string>',
'SchemaValidationConfigs' => [
[
'Attribute' => 'KEY|VALUE',
],
// ...
],
],
],
'BatchSize' => <integer>,
'BisectBatchOnFunctionError' => true || false,
'DestinationConfig' => [
'OnFailure' => [
'Destination' => '<string>',
],
'OnSuccess' => [
'Destination' => '<string>',
],
],
'DocumentDBEventSourceConfig' => [
'CollectionName' => '<string>',
'DatabaseName' => '<string>',
'FullDocument' => 'UpdateLookup|Default',
],
'Enabled' => true || false,
'EventSourceArn' => '<string>',
'FilterCriteria' => [
'Filters' => [
[
'Pattern' => '<string>',
],
// ...
],
],
'FunctionName' => '<string>', // REQUIRED
'FunctionResponseTypes' => ['<string>', ...],
'KMSKeyArn' => '<string>',
'LoggingConfig' => [
'SystemLogLevel' => 'DEBUG|INFO|WARN',
],
'MaximumBatchingWindowInSeconds' => <integer>,
'MaximumRecordAgeInSeconds' => <integer>,
'MaximumRetryAttempts' => <integer>,
'MetricsConfig' => [
'Metrics' => ['<string>', ...],
],
'ParallelizationFactor' => <integer>,
'ProvisionedPollerConfig' => [
'MaximumPollers' => <integer>,
'MinimumPollers' => <integer>,
'PollerGroupName' => '<string>',
],
'Queues' => ['<string>', ...],
'ScalingConfig' => [
'MaximumConcurrency' => <integer>,
],
'SelfManagedEventSource' => [
'Endpoints' => [
'<EndPointType>' => ['<string>', ...],
// ...
],
],
'SelfManagedKafkaEventSourceConfig' => [
'ConsumerGroupId' => '<string>',
'ConsumptionMode' => 'Stream|Queue',
'SchemaRegistryConfig' => [
'AccessConfigs' => [
[
'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE|OAUTHBEARER_AUTH',
'URI' => '<string>',
],
// ...
],
'EventRecordFormat' => 'JSON|SOURCE',
'SchemaRegistryURI' => '<string>',
'SchemaValidationConfigs' => [
[
'Attribute' => 'KEY|VALUE',
],
// ...
],
],
],
'SourceAccessConfigurations' => [
[
'Type' => 'BASIC_AUTH|VPC_SUBNET|VPC_SECURITY_GROUP|SASL_SCRAM_512_AUTH|SASL_SCRAM_256_AUTH|VIRTUAL_HOST|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE|OAUTHBEARER_AUTH|OAUTHBEARER_SCOPE|OAUTHBEARER_AUDIENCE|OAUTHBEARER_LOGICAL_CLUSTER|OAUTHBEARER_IDENTITY_POOL|IAM_AUTH|IAM_OAUTHBEARER_AUTH',
'URI' => '<string>',
],
// ...
],
'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP',
'StartingPositionTimestamp' => <integer || string || DateTime>,
'Tags' => ['<string>', ...],
'Topics' => ['<string>', ...],
'TumblingWindowInSeconds' => <integer>,
]);
Parameter Details
Members
- AmazonManagedKafkaEventSourceConfig
-
- Type: AmazonManagedKafkaEventSourceConfig structure
Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
- BatchSize
-
- Type: int
The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).
-
Amazon Kinesis – Default 100. Max 10,000.
-
Amazon DynamoDB Streams – Default 100. Max 10,000.
-
Amazon Simple Queue Service – Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10.
-
Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000.
-
Self-managed Apache Kafka – Default 100. Max 10,000.
-
Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000.
-
DocumentDB – Default 100. Max 10,000.
- BisectBatchOnFunctionError
-
- Type: boolean
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) If the function returns an error, split the batch in two and retry.
- DestinationConfig
-
- Type: DestinationConfig structure
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A configuration object that specifies the destination of an event after Lambda processes it.
- DocumentDBEventSourceConfig
-
- Type: DocumentDBEventSourceConfig structure
Specific configuration settings for a DocumentDB event source.
- Enabled
-
- Type: boolean
When true, the event source mapping is active. When false, Lambda pauses polling and invocation.
Default: True
- EventSourceArn
-
- Type: string
The Amazon Resource Name (ARN) of the event source.
-
Amazon Kinesis – The ARN of the data stream or a stream consumer.
-
Amazon DynamoDB Streams – The ARN of the stream.
-
Amazon Simple Queue Service – The ARN of the queue.
-
Amazon Managed Streaming for Apache Kafka – The ARN of the cluster or the ARN of the VPC connection (for cross-account event source mappings).
-
Amazon MQ – The ARN of the broker.
-
Amazon DocumentDB – The ARN of the DocumentDB change stream.
- FilterCriteria
-
- Type: FilterCriteria structure
An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering.
- FunctionName
-
- Required: Yes
- Type: string
The name or ARN of the Lambda function.
Name formats
-
Function name –
MyFunction. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:MyFunction. -
Version or Alias ARN –
arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD. -
Partial ARN –
123456789012:function:MyFunction.
The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.
- FunctionResponseTypes
-
- Type: Array of strings
(Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and Amazon SQS) A list of current response type enums applied to the event source mapping.
- KMSKeyArn
-
- Type: string
The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter criteria. By default, Lambda does not encrypt your filter criteria object. Specify this property to encrypt data using your own customer managed key.
- LoggingConfig
-
- Type: EventSourceMappingLoggingConfig structure
(Amazon MSK, and self-managed Apache Kafka only) The logging configuration for your event source. For more information, see Event source mapping logging.
- MaximumBatchingWindowInSeconds
-
- Type: int
The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure
MaximumBatchingWindowInSecondsto any value from 0 seconds to 300 seconds in increments of seconds.For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note that because you can only change
MaximumBatchingWindowInSecondsin increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore the default batching window, you must create a new event source mapping.Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when you set
BatchSizeto a value greater than 10, you must setMaximumBatchingWindowInSecondsto at least 1.Not supported for Kafka event source mappings when
ConsumptionModeisQueue. - MaximumRecordAgeInSeconds
-
- Type: int
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard records older than the specified age. The default value is infinite (-1).
- MaximumRetryAttempts
-
- Type: int
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires.
For Kafka event source mappings with
ConsumptionModeset toQueue, the value -1 (infinite retries) is not supported and the default is 0 (no retries). Lambda releases failed records back to the broker, which redelivers them up to the share group'sgroup.share.delivery.count.limit. - MetricsConfig
-
- Type: EventSourceMappingMetricsConfig structure
The metrics configuration for your event source. For more information, see Event source mapping metrics.
- ParallelizationFactor
-
- Type: int
(Kinesis and DynamoDB Streams only) The number of batches to process from each shard concurrently.
- ProvisionedPollerConfig
-
- Type: ProvisionedPollerConfig structure
(Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The provisioned mode configuration for the event source. For more information, see provisioned mode.
- Queues
-
- Type: Array of strings
(MQ) The name of the Amazon MQ broker destination queue to consume.
- ScalingConfig
-
- Type: ScalingConfig structure
(Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources.
- SelfManagedEventSource
-
- Type: SelfManagedEventSource structure
The self-managed Apache Kafka cluster to receive records from.
- SelfManagedKafkaEventSourceConfig
-
- Type: SelfManagedKafkaEventSourceConfig structure
Specific configuration settings for a self-managed Apache Kafka event source.
- SourceAccessConfigurations
-
- Type: Array of SourceAccessConfiguration structures
An array of authentication protocols or VPC components required to secure your event source.
- StartingPosition
-
- Type: string
The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream event sources.
AT_TIMESTAMPis supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka.Not supported for Kafka event source mappings when
ConsumptionModeisQueue. - StartingPositionTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
With
StartingPositionset toAT_TIMESTAMP, the time from which to start reading.StartingPositionTimestampcannot be in the future.Not supported for Kafka event source mappings when
ConsumptionModeisQueue. - Tags
-
- Type: Associative array of custom strings keys (TagKey) to strings
A list of tags to apply to the event source mapping.
- Topics
-
- Type: Array of strings
The name of the Kafka topic.
- TumblingWindowInSeconds
-
- Type: int
(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.
Result Syntax
[
'AmazonManagedKafkaEventSourceConfig' => [
'ConsumerGroupId' => '<string>',
'SchemaRegistryConfig' => [
'AccessConfigs' => [
[
'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE|OAUTHBEARER_AUTH',
'URI' => '<string>',
],
// ...
],
'EventRecordFormat' => 'JSON|SOURCE',
'SchemaRegistryURI' => '<string>',
'SchemaValidationConfigs' => [
[
'Attribute' => 'KEY|VALUE',
],
// ...
],
],
],
'BatchSize' => <integer>,
'BisectBatchOnFunctionError' => true || false,
'DestinationConfig' => [
'OnFailure' => [
'Destination' => '<string>',
],
'OnSuccess' => [
'Destination' => '<string>',
],
],
'DocumentDBEventSourceConfig' => [
'CollectionName' => '<string>',
'DatabaseName' => '<string>',
'FullDocument' => 'UpdateLookup|Default',
],
'EventSourceArn' => '<string>',
'EventSourceMappingArn' => '<string>',
'FilterCriteria' => [
'Filters' => [
[
'Pattern' => '<string>',
],
// ...
],
],
'FilterCriteriaError' => [
'ErrorCode' => '<string>',
'Message' => '<string>',
],
'FunctionArn' => '<string>',
'FunctionResponseTypes' => ['<string>', ...],
'KMSKeyArn' => '<string>',
'LastModified' => <DateTime>,
'LastProcessingResult' => '<string>',
'LoggingConfig' => [
'SystemLogLevel' => 'DEBUG|INFO|WARN',
],
'MaximumBatchingWindowInSeconds' => <integer>,
'MaximumRecordAgeInSeconds' => <integer>,
'MaximumRetryAttempts' => <integer>,
'MetricsConfig' => [
'Metrics' => ['<string>', ...],
],
'ParallelizationFactor' => <integer>,
'ProvisionedPollerConfig' => [
'MaximumPollers' => <integer>,
'MinimumPollers' => <integer>,
'PollerGroupName' => '<string>',
],
'Queues' => ['<string>', ...],
'ScalingConfig' => [
'MaximumConcurrency' => <integer>,
],
'SelfManagedEventSource' => [
'Endpoints' => [
'<EndPointType>' => ['<string>', ...],
// ...
],
],
'SelfManagedKafkaEventSourceConfig' => [
'ConsumerGroupId' => '<string>',
'ConsumptionMode' => 'Stream|Queue',
'SchemaRegistryConfig' => [
'AccessConfigs' => [
[
'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE|OAUTHBEARER_AUTH',
'URI' => '<string>',
],
// ...
],
'EventRecordFormat' => 'JSON|SOURCE',
'SchemaRegistryURI' => '<string>',
'SchemaValidationConfigs' => [
[
'Attribute' => 'KEY|VALUE',
],
// ...
],
],
],
'SourceAccessConfigurations' => [
[
'Type' => 'BASIC_AUTH|VPC_SUBNET|VPC_SECURITY_GROUP|SASL_SCRAM_512_AUTH|SASL_SCRAM_256_AUTH|VIRTUAL_HOST|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE|OAUTHBEARER_AUTH|OAUTHBEARER_SCOPE|OAUTHBEARER_AUDIENCE|OAUTHBEARER_LOGICAL_CLUSTER|OAUTHBEARER_IDENTITY_POOL|IAM_AUTH|IAM_OAUTHBEARER_AUTH',
'URI' => '<string>',
],
// ...
],
'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP',
'StartingPositionTimestamp' => <DateTime>,
'State' => '<string>',
'StateTransitionReason' => '<string>',
'Topics' => ['<string>', ...],
'TumblingWindowInSeconds' => <integer>,
'UUID' => '<string>',
]
Result Details
Members
- AmazonManagedKafkaEventSourceConfig
-
- Type: AmazonManagedKafkaEventSourceConfig structure
Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
- BatchSize
-
- Type: int
The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).
Default value: Varies by service. For Amazon SQS, the default is 10. For all other services, the default is 100.
Related setting: When you set
BatchSizeto a value greater than 10, you must setMaximumBatchingWindowInSecondsto at least 1. - BisectBatchOnFunctionError
-
- Type: boolean
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) If the function returns an error, split the batch in two and retry. The default value is false.
- DestinationConfig
-
- Type: DestinationConfig structure
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A configuration object that specifies the destination of an event after Lambda processes it.
- DocumentDBEventSourceConfig
-
- Type: DocumentDBEventSourceConfig structure
Specific configuration settings for a DocumentDB event source.
- EventSourceArn
-
- Type: string
The Amazon Resource Name (ARN) of the event source.
- EventSourceMappingArn
-
- Type: string
The Amazon Resource Name (ARN) of the event source mapping.
- FilterCriteria
-
- Type: FilterCriteria structure
An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering.
If filter criteria is encrypted, this field shows up as
nullin the response of ListEventSourceMapping API calls. You can view this field in plaintext in the response of GetEventSourceMapping and DeleteEventSourceMapping calls if you havekms:Decryptpermissions for the correct KMS key. - FilterCriteriaError
-
- Type: FilterCriteriaError structure
An object that contains details about an error related to filter criteria encryption.
- FunctionArn
-
- Type: string
The ARN of the Lambda function.
- FunctionResponseTypes
-
- Type: Array of strings
(Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and Amazon SQS) A list of current response type enums applied to the event source mapping.
- KMSKeyArn
-
- Type: string
The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter criteria.
- LastModified
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The date that the event source mapping was last updated or that its state changed.
- LastProcessingResult
-
- Type: string
The result of the event source mapping's last processing attempt.
- LoggingConfig
-
- Type: EventSourceMappingLoggingConfig structure
(Amazon MSK, and self-managed Apache Kafka only) The logging configuration for your event source. For more information, see Event source mapping logging.
- MaximumBatchingWindowInSeconds
-
- Type: int
The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure
MaximumBatchingWindowInSecondsto any value from 0 seconds to 300 seconds in increments of seconds.For streams and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note that because you can only change
MaximumBatchingWindowInSecondsin increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore the default batching window, you must create a new event source mapping.Related setting: For streams and Amazon SQS event sources, when you set
BatchSizeto a value greater than 10, you must setMaximumBatchingWindowInSecondsto at least 1. - MaximumRecordAgeInSeconds
-
- Type: int
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard records older than the specified age. The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records.
The minimum valid value for maximum record age is 60s. Although values less than 60 and greater than -1 fall within the parameter's absolute range, they are not allowed
- MaximumRetryAttempts
-
- Type: int
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard records after the specified number of retries. The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.
- MetricsConfig
-
- Type: EventSourceMappingMetricsConfig structure
The metrics configuration for your event source. For more information, see Event source mapping metrics.
- ParallelizationFactor
-
- Type: int
(Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
- ProvisionedPollerConfig
-
- Type: ProvisionedPollerConfig structure
(Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The provisioned mode configuration for the event source. For more information, see provisioned mode.
- Queues
-
- Type: Array of strings
(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
- ScalingConfig
-
- Type: ScalingConfig structure
(Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources.
- SelfManagedEventSource
-
- Type: SelfManagedEventSource structure
The self-managed Apache Kafka cluster for your event source.
- SelfManagedKafkaEventSourceConfig
-
- Type: SelfManagedKafkaEventSourceConfig structure
Specific configuration settings for a self-managed Apache Kafka event source.
- SourceAccessConfigurations
-
- Type: Array of SourceAccessConfiguration structures
An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
- StartingPosition
-
- Type: string
The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream event sources.
AT_TIMESTAMPis supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka. - StartingPositionTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
With
StartingPositionset toAT_TIMESTAMP, the time from which to start reading.StartingPositionTimestampcannot be in the future. - State
-
- Type: string
The state of the event source mapping. It can be one of the following:
Creating,Enabling,Enabled,Disabling,Disabled,Updating, orDeleting. - StateTransitionReason
-
- Type: string
Indicates whether a user or Lambda made the last change to the event source mapping.
- Topics
-
- Type: Array of strings
The name of the Kafka topic.
- TumblingWindowInSeconds
-
- Type: int
(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.
- UUID
-
- Type: string
The identifier of the event source mapping.
Errors
- InvalidParameterValueException:
One of the parameters in the request is not valid.
- ResourceConflictException:
The resource already exists, or another operation is in progress.
- ServiceException:
The Lambda service encountered an internal error.
- TooManyRequestsException:
The request throughput limit was exceeded. For more information, see Lambda quotas.
- ResourceNotFoundException:
The resource specified in the request does not exist.
Examples
Example 1: To create a mapping between an event source and an AWS Lambda function
The following example creates a mapping between an SQS queue and the my-function Lambda function.
$result = $client->createEventSourceMapping([
'BatchSize' => 5,
'EventSourceArn' => 'arn:aws:sqs:us-west-2:123456789012:my-queue',
'FunctionName' => 'my-function',
]);
Result syntax:
[
'BatchSize' => 5,
'EventSourceArn' => 'arn:aws:sqs:us-west-2:123456789012:my-queue',
'FunctionArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function',
'LastModified' => ,
'State' => 'Creating',
'StateTransitionReason' => 'USER_INITIATED',
'UUID' => 'a1b2c3d4-5678-90ab-cdef-11111EXAMPLE',
]
CreateFunction
$result = $client->createFunction([/* ... */]); $promise = $client->createFunctionAsync([/* ... */]);
Creates a Lambda Event Function. To create a function, you need a deployment package and an execution role. The deployment package is a .zip file archive or container image that contains your function code. The execution role grants the function permission to use Amazon Web Services services, such as Amazon CloudWatch Logs for log streaming and X-Ray for request tracing.
If the deployment package is a container image, then you set the package type to Image. For a container image, the code property must include the URI of a container image in the Amazon ECR registry. You do not need to specify the handler and runtime properties.
If the deployment package is a .zip file archive, then you set the package type to Zip. For a .zip file archive, the code property specifies the location of the .zip file. You must also specify the handler and runtime properties. The code in the deployment package must be compatible with the target instruction set architecture of the function (x86-64 or arm64). If you do not specify the architecture, then the default value is x86-64.
When you create a function, Lambda provisions an instance of the function and its supporting resources. If your function connects to a VPC, this process can take a minute or so. During this time, you can't invoke or modify the function. The State, StateReason, and StateReasonCode fields in the response from GetFunctionConfiguration indicate when the function is ready to invoke. For more information, see Lambda function states.
A function has an unpublished version, and can have published versions and aliases. The unpublished version changes when you update your function's code and configuration. A published version is a snapshot of your function code and configuration that can't be changed. An alias is a named resource that maps to a version, and can be changed to map to a different version. Use the Publish parameter to create version 1 of your function from its initial configuration.
The other parameters let you configure version-specific and function-level settings. You can modify version-specific settings later with UpdateFunctionConfiguration. Function-level settings apply to both the unpublished and published versions of the function, and include tags (TagResource) and per-function concurrency limits (PutFunctionConcurrency).
You can use code signing if your deployment package is a .zip file archive. To enable code signing for this function, specify the ARN of a code-signing configuration. When a user attempts to deploy a code package with UpdateFunctionCode, Lambda checks that the code package has a valid signature from a trusted publisher. The code-signing configuration includes set of signing profiles, which define the trusted publishers for this function.
If another Amazon Web Services account or an Amazon Web Services service invokes your function, use AddPermission to grant permission by creating a resource-based Identity and Access Management (IAM) policy. You can grant permissions at the function level, on a version, or on an alias.
To invoke your function directly, use Invoke. To invoke your function in response to events in other Amazon Web Services services, create an event source mapping (CreateEventSourceMapping), or configure a function trigger in the other service. For more information, see Invoking Lambda functions.
Parameter Syntax
$result = $client->createFunction([
'AcceleratorConfig' => [
'AcceleratorMemorySize' => <integer>, // REQUIRED
],
'Architectures' => ['<string>', ...],
'CapacityProviderConfig' => [
'LambdaManagedInstancesCapacityProviderConfig' => [ // REQUIRED
'CapacityProviderArn' => '<string>', // REQUIRED
'ExecutionEnvironmentMemoryGiBPerVCpu' => <float>,
'PerExecutionEnvironmentMaxConcurrency' => <integer>,
],
],
'Code' => [ // REQUIRED
'ImageUri' => '<string>',
'S3Bucket' => '<string>',
'S3Key' => '<string>',
'S3ObjectStorageMode' => 'COPY|REFERENCE',
'S3ObjectVersion' => '<string>',
'SourceKMSKeyArn' => '<string>',
'ZipFile' => <string || resource || Psr\Http\Message\StreamInterface>,
],
'CodeSigningConfigArn' => '<string>',
'DeadLetterConfig' => [
'TargetArn' => '<string>',
],
'Description' => '<string>',
'DurableConfig' => [
'ExecutionTimeout' => <integer>,
'KMSKeyArn' => '<string>',
'RetentionPeriodInDays' => <integer>,
],
'Environment' => [
'Variables' => ['<string>', ...],
],
'EphemeralStorage' => [
'Size' => <integer>, // REQUIRED
],
'FileSystemConfigs' => [
[
'Arn' => '<string>', // REQUIRED
'LocalMountPath' => '<string>', // REQUIRED
'S3FilesConfig' => [
'DirectS3Read' => 'ENABLED|DISABLED|AUTO',
],
],
// ...
],
'FunctionName' => '<string>', // REQUIRED
'Handler' => '<string>',
'ImageConfig' => [
'Command' => ['<string>', ...],
'EntryPoint' => ['<string>', ...],
'WorkingDirectory' => '<string>',
],
'KMSKeyArn' => '<string>',
'Layers' => ['<string>', ...],
'LoggingConfig' => [
'ApplicationLogLevel' => 'TRACE|DEBUG|INFO|WARN|ERROR|FATAL',
'LogFormat' => 'JSON|Text',
'LogGroup' => '<string>',
'SystemLogLevel' => 'DEBUG|INFO|WARN',
],
'MemorySize' => <integer>,
'PackageType' => 'Zip|Image',
'Publish' => true || false,
'PublishTo' => 'LATEST_PUBLISHED',
'Role' => '<string>', // REQUIRED
'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|nodejs14.x|nodejs16.x|nodejs18.x|nodejs20.x|nodejs22.x|nodejs24.x|java8|java8.al2|java11|java17|java21|java25|python2.7|python3.6|python3.7|python3.8|python3.9|python3.10|python3.11|python3.12|python3.13|python3.14|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|dotnet10|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|ruby3.2|ruby3.3|ruby3.4|ruby4.0|provided|provided.al2|provided.al2023|nodejs26.x|python3.15|java8.al2023|java11.al2023|java17.al2023|custom',
'RuntimeConfig' => [
'RuntimeAlias' => '<string>', // REQUIRED
'RuntimeArn' => '<string>', // REQUIRED
],
'SnapStart' => [
'ApplyOn' => 'PublishedVersions|None',
],
'Tags' => ['<string>', ...],
'TenancyConfig' => [
'TenantIsolationMode' => 'PER_TENANT', // REQUIRED
],
'Timeout' => <integer>,
'TracingConfig' => [
'Mode' => 'Active|PassThrough',
],
'VpcConfig' => [
'Ipv6AllowedForDualStack' => true || false,
'SecurityGroupIds' => ['<string>', ...],
'SubnetIds' => ['<string>', ...],
],
]);
Parameter Details
Members
- AcceleratorConfig
-
- Type: AcceleratorConfig structure
The accelerator resource settings for a Lambda execution environment.
- Architectures
-
- Type: Array of strings
The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is
x86_64. - CapacityProviderConfig
-
- Type: CapacityProviderConfig structure
Configuration for the capacity provider that manages compute resources for Lambda functions.
- Code
-
- Required: Yes
- Type: FunctionCode structure
The code for the function.
- CodeSigningConfigArn
-
- Type: string
To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.
- DeadLetterConfig
-
- Type: DeadLetterConfig structure
A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead-letter queues.
- Description
-
- Type: string
A description of the function.
- DurableConfig
-
- Type: DurableConfig structure
Configuration settings for durable functions. Enables creating functions with durability that can remember their state and continue execution even after interruptions.
- Environment
-
- Type: Environment structure
Environment variables that are accessible from function code during execution.
- EphemeralStorage
-
- Type: EphemeralStorage structure
The size of the function's
/tmpdirectory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For functions that useAcceleratorConfig, the maximum is 32,768 MB. For more information, see Configuring ephemeral storage (console). - FileSystemConfigs
-
- Type: Array of FileSystemConfig structures
Connection settings for an Amazon EFS file system or an Amazon S3 Files file system.
- FunctionName
-
- Required: Yes
- Type: string
The name or ARN of the Lambda function.
Name formats
-
Function name –
my-function. -
Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:my-function. -
Partial ARN –
123456789012:function:my-function.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- Handler
-
- Type: string
The name of the method within your code that Lambda calls to run your function. Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Lambda programming model.
- ImageConfig
-
- Type: ImageConfig structure
Container image configuration values that override the values in the container image Dockerfile.
- KMSKeyArn
-
- Type: string
The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt the following resources:
-
The function's environment variables.
-
The function's Lambda SnapStart snapshots.
-
When used with
SourceKMSKeyArn, the unzipped version of the .zip deployment package that's used for function invocations. For more information, see Specifying a customer managed key for Lambda. -
The optimized version of the container image that's used for function invocations. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). For more information, see Function lifecycle.
If you don't provide a customer managed key, Lambda uses an Amazon Web Services owned key or an Amazon Web Services managed key.
- Layers
-
- Type: Array of strings
A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.
- LoggingConfig
-
- Type: LoggingConfig structure
The function's Amazon CloudWatch Logs configuration settings.
- MemorySize
-
- Type: int
The amount of memory available to the function at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB.
- PackageType
-
- Type: string
The type of deployment package. Set to
Imagefor container image and set toZipfor .zip file archive. - Publish
-
- Type: boolean
Set to true to publish the first version of the function during creation.
- PublishTo
-
- Type: string
Specifies where to publish the function version or configuration.
- Role
-
- Required: Yes
- Type: string
The Amazon Resource Name (ARN) of the function's execution role.
- Runtime
-
- Type: string
The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
- RuntimeConfig
-
- Type: FunctionRuntimeConfig structure
The customer-managed runtime configuration for your function. Specifies the customer-managed runtime and the runtime alias that your function uses.
- SnapStart
-
- Type: SnapStart structure
The function's SnapStart setting.
- Tags
-
- Type: Associative array of custom strings keys (TagKey) to strings
A list of tags to apply to the function.
- TenancyConfig
-
- Type: TenancyConfig structure
Configuration for multi-tenant applications that use Lambda functions. Defines tenant isolation settings and resource allocations. Required for functions supporting multiple tenants.
- Timeout
-
- Type: int
The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds, and the maximum allowed value is 900 seconds. For functions using Lambda Managed Instances, asynchronous invocations and event source mapping invocations (except Amazon MQ and Amazon DocumentDB) support a maximum allowed value of 5,400 seconds (90 minutes). For more information, see Lambda execution environment.
- TracingConfig
-
- Type: TracingConfig structure
Set
ModetoActiveto sample and trace a subset of incoming requests with X-Ray. - VpcConfig
-
- Type: VpcConfig structure
For network connectivity to Amazon Web Services resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see Configuring a Lambda function to access resources in a VPC.
Result Syntax
[
'AcceleratorConfig' => [
'AcceleratorMemorySize' => <integer>,
],
'Architectures' => ['<string>', ...],
'CapacityProviderConfig' => [
'LambdaManagedInstancesCapacityProviderConfig' => [
'CapacityProviderArn' => '<string>',
'ExecutionEnvironmentMemoryGiBPerVCpu' => <float>,
'PerExecutionEnvironmentMaxConcurrency' => <integer>,
],
],
'CodeSha256' => '<string>',
'CodeSize' => <integer>,
'ConfigSha256' => '<string>',
'DeadLetterConfig' => [
'TargetArn' => '<string>',
],
'Description' => '<string>',
'DurableConfig' => [
'ExecutionTimeout' => <integer>,
'KMSKeyArn' => '<string>',
'RetentionPeriodInDays' => <integer>,
],
'Environment' => [
'Error' => [
'ErrorCode' => '<string>',
'Message' => '<string>',
],
'Variables' => ['<string>', ...],
],
'EphemeralStorage' => [
'Size' => <integer>,
],
'FileSystemConfigs' => [
[
'Arn' => '<string>',
'LocalMountPath' => '<string>',
'S3FilesConfig' => [
'DirectS3Read' => 'ENABLED|DISABLED|AUTO',
],
],
// ...
],
'FunctionArn' => '<string>',
'FunctionName' => '<string>',
'Handler' => '<string>',
'ImageConfigResponse' => [
'Error' => [
'ErrorCode' => '<string>',
'Message' => '<string>',
],
'ImageConfig' => [
'Command' => ['<string>', ...],
'EntryPoint' => ['<string>', ...],
'WorkingDirectory' => '<string>',
],
],
'KMSKeyArn' => '<string>',
'LastModified' => '<string>',
'LastUpdateStatus' => 'Successful|Failed|InProgress',
'LastUpdateStatusReason' => '<string>',
'LastUpdateStatusReasonCode' => 'EniLimitExceeded|InsufficientRolePermissions|InvalidConfiguration|InternalError|SubnetOutOfIPAddresses|InvalidSubnet|InvalidSecurityGroup|ImageDeleted|ImageAccessDenied|InvalidImage|KMSKeyAccessDenied|KMSKeyNotFound|InvalidStateKMSKey|DisabledKMSKey|EFSIOError|EFSMountConnectivityError|EFSMountFailure|EFSMountTimeout|InvalidRuntime|InvalidZipFileException|FunctionError|ServiceQuotaExceededException|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl|IncompatibleAcceleratorInstanceTypes|DependencyError',
'Layers' => [
[
'Arn' => '<string>',
'CodeSize' => <integer>,
'SigningJobArn' => '<string>',
'SigningProfileVersionArn' => '<string>',
],
// ...
],
'LoggingConfig' => [
'ApplicationLogLevel' => 'TRACE|DEBUG|INFO|WARN|ERROR|FATAL',
'LogFormat' => 'JSON|Text',
'LogGroup' => '<string>',
'SystemLogLevel' => 'DEBUG|INFO|WARN',
],
'MasterArn' => '<string>',
'MemorySize' => <integer>,
'PackageType' => 'Zip|Image',
'RevisionId' => '<string>',
'Role' => '<string>',
'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|nodejs14.x|nodejs16.x|nodejs18.x|nodejs20.x|nodejs22.x|nodejs24.x|java8|java8.al2|java11|java17|java21|java25|python2.7|python3.6|python3.7|python3.8|python3.9|python3.10|python3.11|python3.12|python3.13|python3.14|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|dotnet10|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|ruby3.2|ruby3.3|ruby3.4|ruby4.0|provided|provided.al2|provided.al2023|nodejs26.x|python3.15|java8.al2023|java11.al2023|java17.al2023|custom',
'RuntimeConfig' => [
'RuntimeAlias' => '<string>',
'RuntimeArn' => '<string>',
],
'RuntimeVersionConfig' => [
'Error' => [
'ErrorCode' => '<string>',
'Message' => '<string>',
],
'RuntimeVersionArn' => '<string>',
],
'SigningJobArn' => '<string>',
'SigningProfileVersionArn' => '<string>',
'SnapStart' => [
'ApplyOn' => 'PublishedVersions|None',
'OptimizationStatus' => 'On|Off',
],
'State' => 'Pending|Active|Inactive|Failed|Deactivating|Deactivated|ActiveNonInvocable|Deleting',
'StateReason' => '<string>',
'StateReasonCode' => 'Idle|Creating|Restoring|EniLimitExceeded|InsufficientRolePermissions|InvalidConfiguration|InternalError|SubnetOutOfIPAddresses|InvalidSubnet|InvalidSecurityGroup|ImageDeleted|ImageAccessDenied|InvalidImage|KMSKeyAccessDenied|KMSKeyNotFound|InvalidStateKMSKey|DisabledKMSKey|EFSIOError|EFSMountConnectivityError|EFSMountFailure|EFSMountTimeout|InvalidRuntime|InvalidZipFileException|FunctionError|ServiceQuotaExceededException|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl|DrainingDurableExecutions|IncompatibleAcceleratorInstanceTypes|DependencyError',
'TenancyConfig' => [
'TenantIsolationMode' => 'PER_TENANT',
],
'Timeout' => <integer>,
'TracingConfig' => [
'Mode' => 'Active|PassThrough',
],
'Version' => '<string>',
'VpcConfig' => [
'Ipv6AllowedForDualStack' => true || false,
'SecurityGroupIds' => ['<string>', ...],
'SubnetIds' => ['<string>', ...],
'VpcId' => '<string>',
],
]
Result Details
Members
- AcceleratorConfig
-
- Type: AcceleratorConfig structure
The accelerator resource settings for a Lambda execution environment.
- Architectures
-
- Type: Array of strings
The instruction set architecture that the function supports. Architecture is a string array with one of the valid values. The default architecture value is
x86_64. - CapacityProviderConfig
-
- Type: CapacityProviderConfig structure
Configuration for the capacity provider that manages compute resources for Lambda functions.
- CodeSha256
-
- Type: string
The SHA256 hash of the function's deployment package.
- CodeSize
-
- Type: long (int|float)
The size of the function's deployment package, in bytes.
- ConfigSha256
-
- Type: string
The SHA256 hash of the function configuration.
- DeadLetterConfig
-
- Type: DeadLetterConfig structure
The function's dead letter queue.
- Description
-
- Type: string
The function's description.
- DurableConfig
-
- Type: DurableConfig structure
The function's durable execution configuration settings, if the function is configured for durability.
- Environment
-
- Type: EnvironmentResponse structure
The function's environment variables. Omitted from CloudTrail logs.
- EphemeralStorage
-
- Type: EphemeralStorage structure
The size of the function's
/tmpdirectory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For functions that useAcceleratorConfig, the maximum is 32,768 MB. For more information, see Configuring ephemeral storage (console). - FileSystemConfigs
-
- Type: Array of FileSystemConfig structures
Connection settings for an Amazon EFS file system or an Amazon S3 file system.
- FunctionArn
-
- Type: string
The function's Amazon Resource Name (ARN).
- FunctionName
-
- Type: string
The name of the function.
- Handler
-
- Type: string
The function that Lambda calls to begin running your function.
- ImageConfigResponse
-
- Type: ImageConfigResponse structure
The function's image configuration values.
- KMSKeyArn
-
- Type: string
The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt the following resources:
-
The function's environment variables.
-
The function's Lambda SnapStart snapshots.
-
When used with
SourceKMSKeyArn, the unzipped version of the .zip deployment package that's used for function invocations. For more information, see Specifying a customer managed key for Lambda. -
The optimized version of the container image that's used for function invocations. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). For more information, see Function lifecycle.
If you don't provide a customer managed key, Lambda uses an Amazon Web Services owned key or an Amazon Web Services managed key.
- LastModified
-
- Type: string
The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
- LastUpdateStatus
-
- Type: string
The status of the last update that was performed on the function. This is first set to
Successfulafter function creation completes. - LastUpdateStatusReason
-
- Type: string
The reason for the last update that was performed on the function.
- LastUpdateStatusReasonCode
-
- Type: string
The reason code for the last update that was performed on the function.
- Layers
-
- Type: Array of Layer structures
The function's layers.
- LoggingConfig
-
- Type: LoggingConfig structure
The function's Amazon CloudWatch Logs configuration settings.
- MasterArn
-
- Type: string
For Lambda@Edge functions, the ARN of the main function.
- MemorySize
-
- Type: int
The amount of memory available to the function at runtime.
- PackageType
-
- Type: string
The type of deployment package. Set to
Imagefor container image and setZipfor .zip file archive. - RevisionId
-
- Type: string
The latest updated revision of the function or alias.
- Role
-
- Type: string
The function's execution role.
- Runtime
-
- Type: string
The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in an error if you're deploying a function using a container image.
The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing functions shortly after each runtime is deprecated. For more information, see Runtime use after deprecation.
For a list of all currently supported runtimes, see Supported runtimes.
- RuntimeConfig
-
- Type: FunctionRuntimeConfig structure
The customer-managed runtime configuration for your function. Specifies the customer-managed runtime and the runtime alias that your function uses.
- RuntimeVersionConfig
-
- Type: RuntimeVersionConfig structure
The ARN of the runtime and any errors that occured.
- SigningJobArn
-
- Type: string
The ARN of the signing job.
- SigningProfileVersionArn
-
- Type: string
The ARN of the signing profile version.
- SnapStart
-
- Type: SnapStartResponse structure
Set
ApplyOntoPublishedVersionsto create a snapshot of the initialized execution environment when you publish a function version. For more information, see Improving startup performance with Lambda SnapStart. - State
-
- Type: string
The current state of the function. When the state is
Inactive, you can reactivate the function by invoking it. - StateReason
-
- Type: string
The reason for the function's current state.
- StateReasonCode
-
- Type: string
The reason code for the function's current state. When the code is
Creating, you can't invoke or modify the function. - TenancyConfig
-
- Type: TenancyConfig structure
The function's tenant isolation configuration settings. Determines whether the Lambda function runs on a shared or dedicated infrastructure per unique tenant.
- Timeout
-
- Type: int
The amount of time in seconds that Lambda allows a function to run before stopping it.
- TracingConfig
-
- Type: TracingConfigResponse structure
The function's X-Ray tracing configuration.
- Version
-
- Type: string
The version of the Lambda function.
- VpcConfig
-
- Type: VpcConfigResponse structure
The function's networking configuration.
Errors
- InvalidParameterValueException:
One of the parameters in the request is not valid.
- ResourceConflictException:
The resource already exists, or another operation is in progress.
- ServiceException:
The Lambda service encountered an internal error.
- TooManyRequestsException:
The request throughput limit was exceeded. For more information, see Lambda quotas.
- InvalidCodeSignatureException:
The code signature failed the integrity check. If the integrity check fails, then Lambda blocks deployment, even if the code signing policy is set to WARN.
- ResourceNotFoundException:
The resource specified in the request does not exist.
- CodeVerificationFailedException:
The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE. Lambda blocks the deployment.
- CodeSigningConfigNotFoundException:
The specified code signing configuration does not exist.
- CodeStorageExceededException:
Your Amazon Web Services account has exceeded its maximum total code size. For more information, see