SDK for PHP V3

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 function version.
CreateCapacityProvider ( array $params = [] )
Creates a capacity provider that manages compute resources for Lambda functions
CreateCodeSigningConfig ( array $params = [] )
Creates a code signing configuration.
CreateEventSourceMapping ( array $params = [] )
Creates a mapping between an event source and an Lambda function.
CreateFunction ( array $params = [] )
Creates a Lambda function.
CreateFunctionUrlConfig ( array $params = [] )
Creates a Lambda function URL with the specified configuration parameters.
DeleteAlias ( array $params = [] )
Deletes a Lambda function alias.
DeleteCapacityProvider ( array $params = [] )
Deletes a capacity provider.
DeleteCodeSigningConfig ( array $params = [] )
Deletes the code signing configuration.
DeleteEventSourceMapping ( array $params = [] )
Deletes an event source mapping.
DeleteFunction ( array $params = [] )
Deletes a Lambda function.
DeleteFunctionCodeSigningConfig ( array $params = [] )
Removes the code signing configuration from the function.
DeleteFunctionConcurrency ( array $params = [] )
Removes a concurrent execution limit from a 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.
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 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 the 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 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.
GetRuntimeManagementConfig ( array $params = [] )
Retrieves the runtime management configuration for a function's version.
Invoke ( array $params = [] )
Invokes a Lambda function.
InvokeAsynchronous ( array $params = [] )
For asynchronous function invocation, use Invoke.
InvokeWithResponseStream ( array $params = [] )
Configure your Lambda functions to stream response payloads back to clients.
ListAliases ( array $params = [] )
Returns a list of aliases for a Lambda 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 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 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, with the version-specific configuration of each.
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 function.
PutFunctionCodeSigningConfig ( array $params = [] )
Update the code signing configuration for the function.
PutFunctionConcurrency ( array $params = [] )
Sets the maximum number of simultaneous executions for a 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 your function's recursive loop detection configuration.
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.
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.
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 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 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 function's code.
UpdateFunctionConfiguration ( array $params = [] )
Modify the version-specific settings of a Lambda function.
UpdateFunctionEventInvokeConfig ( array $params = [] )
Updates the configuration for asynchronous invocation for a function, version, or alias.
UpdateFunctionUrlConfig ( array $params = [] )
Updates the configuration for a Lambda function URL.

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 (if organizationId is 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 GetPolicy to retrieve the latest RevisionId for your resource.

  • For all other API operations: Call GetFunction or GetAlias to 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:InvokeFunction or lambda: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 namemy-function (name-only), my-function:v1 (with alias).

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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_IAM if you want to restrict access to authenticated users only. Set to NONE if 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 SourceArn or SourceAccount to 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 SourceArn to 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 StringLike operator.

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.

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 GetPolicy to retrieve the latest RevisionId for your resource.

  • For all other API operations: Call GetFunction or GetAlias to 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>',
            ],
            '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.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

ServiceException:

The Lambda service encountered an internal error.

CreateAlias

$result = $client->createAlias([/* ... */]);
$promise = $client->createAliasAsync([/* ... */]);

Creates an alias for a Lambda 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.

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 functions

Parameter Syntax

$result = $client->createCapacityProvider([
    'CapacityProviderName' => '<string>', // REQUIRED
    'CapacityProviderScalingConfig' => [
        'MaxVCpuCount' => <integer>,
        'ScalingMode' => 'Auto|Manual',
        'ScalingPolicies' => [
            [
                'PredefinedMetricType' => 'LambdaCapacityProviderAverageCPUUtilization', // REQUIRED
                'TargetValue' => <float>, // REQUIRED
            ],
            // ...
        ],
    ],
    'InstanceRequirements' => [
        'AllowedInstanceTypes' => ['<string>', ...],
        'Architectures' => ['<string>', ...],
        'ExcludedInstanceTypes' => ['<string>', ...],
    ],
    'KmsKeyArn' => '<string>',
    'PermissionsConfig' => [ // REQUIRED
        'CapacityProviderOperatorRoleArn' => '<string>', // REQUIRED
    ],
    'Tags' => ['<string>', ...],
    'VpcConfig' => [ // REQUIRED
        'SecurityGroupIds' => ['<string>', ...], // REQUIRED
        'SubnetIds' => ['<string>', ...], // REQUIRED
    ],
]);

Parameter Details

Members
CapacityProviderName
Required: Yes
Type: string

The name of the capacity provider.

CapacityProviderScalingConfig

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.

Tags
Type: Associative array of custom strings keys (TagKey) to strings

A list of tags to associate with the capacity provider.

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',
                    'TargetValue' => <float>,
                ],
                // ...
            ],
        ],
        'InstanceRequirements' => [
            'AllowedInstanceTypes' => ['<string>', ...],
            'Architectures' => ['<string>', ...],
            'ExcludedInstanceTypes' => ['<string>', ...],
        ],
        'KmsKeyArn' => '<string>',
        'LastModified' => '<string>',
        'PermissionsConfig' => [
            'CapacityProviderOperatorRoleArn' => '<string>',
        ],
        'State' => 'Pending|Active|Failed|Deleting',
        '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 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',
                    '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>',
    '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>',
        'SchemaRegistryConfig' => [
            'AccessConfigs' => [
                [
                    'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE',
                    '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',
            'URI' => '<string>',
        ],
        // ...
    ],
    'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP',
    'StartingPositionTimestamp' => <integer || string || DateTime>,
    'Tags' => ['<string>', ...],
    'Topics' => ['<string>', ...],
    'TumblingWindowInSeconds' => <integer>,
]);

Parameter Details

Members
AmazonManagedKafkaEventSourceConfig

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 nameMyFunction.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction.

  • Version or Alias ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.

  • Partial ARN123456789012: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.

MaximumBatchingWindowInSeconds
Type: int

The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure MaximumBatchingWindowInSeconds to 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 MaximumBatchingWindowInSeconds in 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 BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to 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 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.

MetricsConfig

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

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_TIMESTAMP is 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 StartingPosition set to AT_TIMESTAMP, the time from which to start reading. StartingPositionTimestamp cannot be in the future.

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',
                    '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>',
    '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>',
        'SchemaRegistryConfig' => [
            'AccessConfigs' => [
                [
                    'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE',
                    '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',
            'URI' => '<string>',
        ],
        // ...
    ],
    'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP',
    'StartingPositionTimestamp' => <DateTime>,
    'State' => '<string>',
    'StateTransitionReason' => '<string>',
    'Topics' => ['<string>', ...],
    'TumblingWindowInSeconds' => <integer>,
    'UUID' => '<string>',
]

Result Details

Members
AmazonManagedKafkaEventSourceConfig

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 BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to 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 null in the response of ListEventSourceMapping API calls. You can view this field in plaintext in the response of GetEventSourceMapping and DeleteEventSourceMapping calls if you have kms:Decrypt permissions 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.

MaximumBatchingWindowInSeconds
Type: int

The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure MaximumBatchingWindowInSeconds to 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 MaximumBatchingWindowInSeconds in 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 BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to 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

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

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_TIMESTAMP is 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 StartingPosition set to AT_TIMESTAMP, the time from which to start reading. StartingPositionTimestamp cannot 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, or Deleting.

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 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([
    'Architectures' => ['<string>', ...],
    'CapacityProviderConfig' => [
        'LambdaManagedInstancesCapacityProviderConfig' => [ // REQUIRED
            'CapacityProviderArn' => '<string>', // REQUIRED
            'ExecutionEnvironmentMemoryGiBPerVCpu' => <float>,
            'PerExecutionEnvironmentMaxConcurrency' => <integer>,
        ],
    ],
    'Code' => [ // REQUIRED
        'ImageUri' => '<string>',
        'S3Bucket' => '<string>',
        'S3Key' => '<string>',
        'S3ObjectVersion' => '<string>',
        'SourceKMSKeyArn' => '<string>',
        'ZipFile' => <string || resource || Psr\Http\Message\StreamInterface>,
    ],
    'CodeSigningConfigArn' => '<string>',
    'DeadLetterConfig' => [
        'TargetArn' => '<string>',
    ],
    'Description' => '<string>',
    'DurableConfig' => [
        'ExecutionTimeout' => <integer>,
        'RetentionPeriodInDays' => <integer>,
    ],
    'Environment' => [
        'Variables' => ['<string>', ...],
    ],
    'EphemeralStorage' => [
        'Size' => <integer>, // REQUIRED
    ],
    'FileSystemConfigs' => [
        [
            'Arn' => '<string>', // REQUIRED
            'LocalMountPath' => '<string>', // REQUIRED
        ],
        // ...
    ],
    '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|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|python3.9|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2|nodejs18.x|python3.10|java17|ruby3.2|ruby3.3|ruby3.4|python3.11|nodejs20.x|provided.al2023|python3.12|java21|python3.13|nodejs22.x|nodejs24.x|python3.14|java25',
    '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
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 /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).

FileSystemConfigs
Type: Array of FileSystemConfig structures

Connection settings for an Amazon EFS file system.

FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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 Image for container image and set to Zip for .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.

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. The maximum allowed value is 900 seconds. For more information, see Lambda execution environment.

TracingConfig
Type: TracingConfig structure

Set Mode to Active to 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

[
    'Architectures' => ['<string>', ...],
    'CapacityProviderConfig' => [
        'LambdaManagedInstancesCapacityProviderConfig' => [
            'CapacityProviderArn' => '<string>',
            'ExecutionEnvironmentMemoryGiBPerVCpu' => <float>,
            'PerExecutionEnvironmentMaxConcurrency' => <integer>,
        ],
    ],
    'CodeSha256' => '<string>',
    'CodeSize' => <integer>,
    'ConfigSha256' => '<string>',
    'DeadLetterConfig' => [
        'TargetArn' => '<string>',
    ],
    'Description' => '<string>',
    'DurableConfig' => [
        'ExecutionTimeout' => <integer>,
        'RetentionPeriodInDays' => <integer>,
    ],
    'Environment' => [
        'Error' => [
            'ErrorCode' => '<string>',
            'Message' => '<string>',
        ],
        'Variables' => ['<string>', ...],
    ],
    'EphemeralStorage' => [
        'Size' => <integer>,
    ],
    'FileSystemConfigs' => [
        [
            'Arn' => '<string>',
            'LocalMountPath' => '<string>',
        ],
        // ...
    ],
    '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|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
    '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|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|python3.9|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2|nodejs18.x|python3.10|java17|ruby3.2|ruby3.3|ruby3.4|python3.11|nodejs20.x|provided.al2023|python3.12|java21|python3.13|nodejs22.x|nodejs24.x|python3.14|java25',
    '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|DrainingDurableExecutions|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
    '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
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 /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).

FileSystemConfigs
Type: Array of FileSystemConfig structures

Connection settings for an Amazon EFS 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 Successful after 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 Image for container image and set Zip for .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.

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 ApplyOn to PublishedVersions to 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 Lambda quotas.

FunctionVersionsPerCapacityProviderLimitExceededException:

The maximum number of function versions that can be associated with a single capacity provider has been exceeded. For more information, see Lambda quotas.

Examples

Example 1: To create a function

The following example creates a function with a deployment package in Amazon S3 and enables X-Ray tracing and environment variable encryption.

$result = $client->createFunction([
    'Code' => [
        'S3Bucket' => 'my-bucket-1xpuxmplzrlbh',
        'S3Key' => 'function.zip',
    ],
    'Description' => 'Process image objects from Amazon S3.',
    'DurableConfig' => [
        'ExecutionTimeout' => 31622400,
        'RetentionPeriodInDays' => 30,
    ],
    'Environment' => [
        'Variables' => [
            'BUCKET' => 'my-bucket-1xpuxmplzrlbh',
            'PREFIX' => 'inbound',
        ],
    ],
    'FunctionName' => 'my-function',
    'Handler' => 'index.handler',
    'KMSKeyArn' => 'arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966',
    'MemorySize' => 256,
    'Publish' => 1,
    'Role' => 'arn:aws:iam::123456789012:role/lambda-role',
    'Runtime' => 'nodejs12.x',
    'Tags' => [
        'DEPARTMENT' => 'Assets',
    ],
    'Timeout' => 15,
    'TracingConfig' => [
        'Mode' => 'Active',
    ],
]);

Result syntax:

[
    'CodeSha256' => 'YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=',
    'CodeSize' => 5797206,
    'Description' => 'Process image objects from Amazon S3.',
    'DurableConfig' => [
        'ExecutionTimeout' => 31622400,
        'RetentionPeriodInDays' => 30,
    ],
    'Environment' => [
        'Variables' => [
            'BUCKET' => 'my-bucket-1xpuxmplzrlbh',
            'PREFIX' => 'inbound',
        ],
    ],
    'FunctionArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function',
    'FunctionName' => 'my-function',
    'Handler' => 'index.handler',
    'KMSKeyArn' => 'arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966',
    'LastModified' => '2020-04-10T19:06:32.563+0000',
    'LastUpdateStatus' => 'Successful',
    'MemorySize' => 256,
    'RevisionId' => 'b75dcd81-xmpl-48a8-a75a-93ba8b5b9727',
    'Role' => 'arn:aws:iam::123456789012:role/lambda-role',
    'Runtime' => 'nodejs12.x',
    'State' => 'Active',
    'Timeout' => 15,
    'TracingConfig' => [
        'Mode' => 'Active',
    ],
    'Version' => '1',
]

CreateFunctionUrlConfig

$result = $client->createFunctionUrlConfig([/* ... */]);
$promise = $client->createFunctionUrlConfigAsync([/* ... */]);

Creates a Lambda function URL with the specified configuration parameters. A function URL is a dedicated HTTP(S) endpoint that you can use to invoke your function.

Parameter Syntax

$result = $client->createFunctionUrlConfig([
    'AuthType' => 'NONE|AWS_IAM', // REQUIRED
    'Cors' => [
        'AllowCredentials' => true || false,
        'AllowHeaders' => ['<string>', ...],
        'AllowMethods' => ['<string>', ...],
        'AllowOrigins' => ['<string>', ...],
        'ExposeHeaders' => ['<string>', ...],
        'MaxAge' => <integer>,
    ],
    'FunctionName' => '<string>', // REQUIRED
    'InvokeMode' => 'BUFFERED|RESPONSE_STREAM',
    'Qualifier' => '<string>',
]);

Parameter Details

Members
AuthType
Required: Yes
Type: string

The type of authentication that your function URL uses. Set to AWS_IAM if you want to restrict access to authenticated users only. Set to NONE if you want to bypass IAM authentication to create a public endpoint. For more information, see Control access to Lambda function URLs.

Cors
Type: Cors structure

The cross-origin resource sharing (CORS) settings for your function URL.

FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

InvokeMode
Type: string

Use one of the following options:

  • BUFFERED – This is the default option. Lambda invokes your function using the Invoke API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB.

  • RESPONSE_STREAM – Your function streams payload results as they become available. Lambda invokes your function using the InvokeWithResponseStream API operation. The maximum response payload size is 200 MB.

Qualifier
Type: string

The alias name.

Result Syntax

[
    'AuthType' => 'NONE|AWS_IAM',
    'Cors' => [
        'AllowCredentials' => true || false,
        'AllowHeaders' => ['<string>', ...],
        'AllowMethods' => ['<string>', ...],
        'AllowOrigins' => ['<string>', ...],
        'ExposeHeaders' => ['<string>', ...],
        'MaxAge' => <integer>,
    ],
    'CreationTime' => '<string>',
    'FunctionArn' => '<string>',
    'FunctionUrl' => '<string>',
    'InvokeMode' => 'BUFFERED|RESPONSE_STREAM',
]

Result Details

Members
AuthType
Required: Yes
Type: string

The type of authentication that your function URL uses. Set to AWS_IAM if you want to restrict access to authenticated users only. Set to NONE if you want to bypass IAM authentication to create a public endpoint. For more information, see Control access to Lambda function URLs.

Cors
Type: Cors structure

The cross-origin resource sharing (CORS) settings for your function URL.

CreationTime
Required: Yes
Type: string

When the function URL was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

FunctionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of your function.

FunctionUrl
Required: Yes
Type: string

The HTTP URL endpoint for your function.

InvokeMode
Type: string

Use one of the following options:

  • BUFFERED – This is the default option. Lambda invokes your function using the Invoke API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB.

  • RESPONSE_STREAM – Your function streams payload results as they become available. Lambda invokes your function using the InvokeWithResponseStream API operation. The maximum response payload size is 200 MB.

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.

DeleteAlias

$result = $client->deleteAlias([/* ... */]);
$promise = $client->deleteAliasAsync([/* ... */]);

Deletes a Lambda function alias.

Parameter Syntax

$result = $client->deleteAlias([
    'FunctionName' => '<string>', // REQUIRED
    'Name' => '<string>', // REQUIRED
]);

Parameter Details

Members
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.

Name
Required: Yes
Type: string

The name of the alias.

Result Syntax

[]

Result Details

The results for this operation are always empty.

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.

Examples

Example 1: To delete a Lambda function alias

The following example deletes an alias named BLUE from a function named my-function

$result = $client->deleteAlias([
    'FunctionName' => 'my-function',
    'Name' => 'BLUE',
]);

DeleteCapacityProvider

$result = $client->deleteCapacityProvider([/* ... */]);
$promise = $client->deleteCapacityProviderAsync([/* ... */]);

Deletes a capacity provider. You cannot delete a capacity provider that is currently being used by Lambda functions.

Parameter Syntax

$result = $client->deleteCapacityProvider([
    'CapacityProviderName' => '<string>', // REQUIRED
]);

Parameter Details

Members
CapacityProviderName
Required: Yes
Type: string

The name of the capacity provider to delete.

Result Syntax

[
    'CapacityProvider' => [
        'CapacityProviderArn' => '<string>',
        'CapacityProviderScalingConfig' => [
            'MaxVCpuCount' => <integer>,
            'ScalingMode' => 'Auto|Manual',
            'ScalingPolicies' => [
                [
                    'PredefinedMetricType' => 'LambdaCapacityProviderAverageCPUUtilization',
                    'TargetValue' => <float>,
                ],
                // ...
            ],
        ],
        'InstanceRequirements' => [
            'AllowedInstanceTypes' => ['<string>', ...],
            'Architectures' => ['<string>', ...],
            'ExcludedInstanceTypes' => ['<string>', ...],
        ],
        'KmsKeyArn' => '<string>',
        'LastModified' => '<string>',
        'PermissionsConfig' => [
            'CapacityProviderOperatorRoleArn' => '<string>',
        ],
        'State' => 'Pending|Active|Failed|Deleting',
        'VpcConfig' => [
            'SecurityGroupIds' => ['<string>', ...],
            'SubnetIds' => ['<string>', ...],
        ],
    ],
]

Result Details

Members
CapacityProvider
Required: Yes
Type: CapacityProvider structure

Information about the deleted capacity provider.

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.

DeleteCodeSigningConfig

$result = $client->deleteCodeSigningConfig([/* ... */]);
$promise = $client->deleteCodeSigningConfigAsync([/* ... */]);

Deletes the code signing configuration. You can delete the code signing configuration only if no function is using it.

Parameter Syntax

$result = $client->deleteCodeSigningConfig([
    'CodeSigningConfigArn' => '<string>', // REQUIRED
]);

Parameter Details

Members
CodeSigningConfigArn
Required: Yes
Type: string

The The Amazon Resource Name (ARN) of the code signing configuration.

Result Syntax

[]

Result Details

The results for this operation are always empty.

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.

ResourceNotFoundException:

The resource specified in the request does not exist.

DeleteEventSourceMapping

$result = $client->deleteEventSourceMapping([/* ... */]);
$promise = $client->deleteEventSourceMappingAsync([/* ... */]);

Deletes an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.

When you delete an event source mapping, it enters a Deleting state and might not be completely deleted for several seconds.

Parameter Syntax

$result = $client->deleteEventSourceMapping([
    'UUID' => '<string>', // REQUIRED
]);

Parameter Details

Members
UUID
Required: Yes
Type: string

The identifier of the event source mapping.

Result Syntax

[
    'AmazonManagedKafkaEventSourceConfig' => [
        'ConsumerGroupId' => '<string>',
        'SchemaRegistryConfig' => [
            'AccessConfigs' => [
                [
                    'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE',
                    '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>',
    '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>',
        'SchemaRegistryConfig' => [
            'AccessConfigs' => [
                [
                    'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE',
                    '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',
            'URI' => '<string>',
        ],
        // ...
    ],
    'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP',
    'StartingPositionTimestamp' => <DateTime>,
    'State' => '<string>',
    'StateTransitionReason' => '<string>',
    'Topics' => ['<string>', ...],
    'TumblingWindowInSeconds' => <integer>,
    'UUID' => '<string>',
]

Result Details

Members
AmazonManagedKafkaEventSourceConfig

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 BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to 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 null in the response of ListEventSourceMapping API calls. You can view this field in plaintext in the response of GetEventSourceMapping and DeleteEventSourceMapping calls if you have kms:Decrypt permissions 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.

MaximumBatchingWindowInSeconds
Type: int

The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure MaximumBatchingWindowInSeconds to 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 MaximumBatchingWindowInSeconds in 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 BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to 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

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

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_TIMESTAMP is 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 StartingPosition set to AT_TIMESTAMP, the time from which to start reading. StartingPositionTimestamp cannot 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, or Deleting.

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.

ResourceInUseException:

The operation conflicts with the resource's availability. For example, you tried to update an event source mapping in the CREATING state, or you tried to delete an event source mapping currently UPDATING.

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 delete a Lambda function event source mapping

The following example deletes an event source mapping. To get a mapping's UUID, use ListEventSourceMappings.

$result = $client->deleteEventSourceMapping([
    'UUID' => '14e0db71-xmpl-4eb5-b481-8945cf9d10c2',
]);

Result syntax:

[
    'BatchSize' => 5,
    'EventSourceArn' => 'arn:aws:sqs:us-west-2:123456789012:my-queue',
    'FunctionArn' => 'arn:aws:lambda:us-east-2:123456789012:function:my-function',
    'LastModified' => ,
    'State' => 'Enabled',
    'StateTransitionReason' => 'USER_INITIATED',
    'UUID' => '14e0db71-xmpl-4eb5-b481-8945cf9d10c2',
]

DeleteFunction

$result = $client->deleteFunction([/* ... */]);
$promise = $client->deleteFunctionAsync([/* ... */]);

Deletes a Lambda function. To delete a specific function version, use the Qualifier parameter. Otherwise, all versions and aliases are deleted. This doesn't require the user to have explicit permissions for DeleteAlias.

A deleted Lambda function cannot be recovered. Ensure that you specify the correct function name and version before deleting.

To delete Lambda event source mappings that invoke a function, use DeleteEventSourceMapping. For Amazon Web Services services and resources that invoke your function directly, delete the trigger in the service where you originally configured it.

Parameter Syntax

$result = $client->deleteFunction([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>',
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function or version.

Name formats

  • Function namemy-function (name-only), my-function:1 (with version).

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Qualifier
Type: string

Specify a version to delete. You can't delete a version that an alias references.

Result Syntax

[
    'StatusCode' => <integer>,
]

Result Details

Members
StatusCode
Type: int

The HTTP status code returned by the operation.

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 delete a version of a Lambda function

The following example deletes version 1 of a Lambda function named my-function.

$result = $client->deleteFunction([
    'FunctionName' => 'my-function',
    'Qualifier' => '1',
]);

DeleteFunctionCodeSigningConfig

$result = $client->deleteFunctionCodeSigningConfig([/* ... */]);
$promise = $client->deleteFunctionCodeSigningConfigAsync([/* ... */]);

Removes the code signing configuration from the function.

Parameter Syntax

$result = $client->deleteFunctionCodeSigningConfig([
    'FunctionName' => '<string>', // REQUIRED
]);

Parameter Details

Members
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.

Result Syntax

[]

Result Details

The results for this operation are always empty.

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.

CodeSigningConfigNotFoundException:

The specified code signing configuration does not exist.

DeleteFunctionConcurrency

$result = $client->deleteFunctionConcurrency([/* ... */]);
$promise = $client->deleteFunctionConcurrencyAsync([/* ... */]);

Removes a concurrent execution limit from a function.

Parameter Syntax

$result = $client->deleteFunctionConcurrency([
    'FunctionName' => '<string>', // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Result Syntax

[]

Result Details

The results for this operation are always empty.

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 remove the reserved concurrent execution limit from a function

The following example deletes the reserved concurrent execution limit from a function named my-function.

$result = $client->deleteFunctionConcurrency([
    'FunctionName' => 'my-function',
]);

DeleteFunctionEventInvokeConfig

$result = $client->deleteFunctionEventInvokeConfig([/* ... */]);
$promise = $client->deleteFunctionEventInvokeConfigAsync([/* ... */]);

Deletes the configuration for asynchronous invocation for a function, version, or alias.

To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

Parameter Syntax

$result = $client->deleteFunctionEventInvokeConfig([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>',
]);

Parameter Details

Members
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.

Qualifier
Type: string

A version number or alias name.

Result Syntax

[]

Result Details

The results for this operation are always empty.

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 delete an asynchronous invocation configuration

The following example deletes the asynchronous invocation configuration for the GREEN alias of a function named my-function.

$result = $client->deleteFunctionEventInvokeConfig([
    'FunctionName' => 'my-function',
    'Qualifier' => 'GREEN',
]);

DeleteFunctionUrlConfig

$result = $client->deleteFunctionUrlConfig([/* ... */]);
$promise = $client->deleteFunctionUrlConfigAsync([/* ... */]);

Deletes a Lambda function URL. When you delete a function URL, you can't recover it. Creating a new function URL results in a different URL address.

Parameter Syntax

$result = $client->deleteFunctionUrlConfig([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>',
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Qualifier
Type: string

The alias name.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

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.

DeleteLayerVersion

$result = $client->deleteLayerVersion([/* ... */]);
$promise = $client->deleteLayerVersionAsync([/* ... */]);

Deletes a version of an Lambda layer. Deleted versions can no longer be viewed or added to functions. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it.

Parameter Syntax

$result = $client->deleteLayerVersion([
    'LayerName' => '<string>', // REQUIRED
    'VersionNumber' => <integer>, // REQUIRED
]);

Parameter Details

Members
LayerName
Required: Yes
Type: string

The name or Amazon Resource Name (ARN) of the layer.

VersionNumber
Required: Yes
Type: long (int|float)

The version number.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

ServiceException:

The Lambda service encountered an internal error.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

Examples

Example 1: To delete a version of a Lambda layer

The following example deletes version 2 of a layer named my-layer.

$result = $client->deleteLayerVersion([
    'LayerName' => 'my-layer',
    'VersionNumber' => 2,
]);

DeleteProvisionedConcurrencyConfig

$result = $client->deleteProvisionedConcurrencyConfig([/* ... */]);
$promise = $client->deleteProvisionedConcurrencyConfigAsync([/* ... */]);

Deletes the provisioned concurrency configuration for a function.

Parameter Syntax

$result = $client->deleteProvisionedConcurrencyConfig([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>', // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Qualifier
Required: Yes
Type: string

The version number or alias name.

Result Syntax

[]

Result Details

The results for this operation are always empty.

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 delete a provisioned concurrency configuration

The following example deletes the provisioned concurrency configuration for the GREEN alias of a function named my-function.

$result = $client->deleteProvisionedConcurrencyConfig([
    'FunctionName' => 'my-function',
    'Qualifier' => 'GREEN',
]);

GetAccountSettings

$result = $client->getAccountSettings([/* ... */]);
$promise = $client->getAccountSettingsAsync([/* ... */]);

Retrieves details about your account's limits and usage in an Amazon Web Services Region.

Parameter Syntax

$result = $client->getAccountSettings([
]);

Parameter Details

Members

Result Syntax

[
    'AccountLimit' => [
        'CodeSizeUnzipped' => <integer>,
        'CodeSizeZipped' => <integer>,
        'ConcurrentExecutions' => <integer>,
        'TotalCodeSize' => <integer>,
        'UnreservedConcurrentExecutions' => <integer>,
    ],
    'AccountUsage' => [
        'FunctionCount' => <integer>,
        'TotalCodeSize' => <integer>,
    ],
]

Result Details

Members
AccountLimit
Type: AccountLimit structure

Limits that are related to concurrency and code storage.

AccountUsage
Type: AccountUsage structure

The number of functions and amount of storage in use.

Errors

ServiceException:

The Lambda service encountered an internal error.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

Examples

Example 1: To get account settings

This operation takes no parameters and returns details about storage and concurrency quotas in the current Region.

$result = $client->getAccountSettings([
]);

Result syntax:

[
    'AccountLimit' => [
        'CodeSizeUnzipped' => 262144000,
        'CodeSizeZipped' => 52428800,
        'ConcurrentExecutions' => 1000,
        'TotalCodeSize' => 80530636800,
        'UnreservedConcurrentExecutions' => 1000,
    ],
    'AccountUsage' => [
        'FunctionCount' => 4,
        'TotalCodeSize' => 9426,
    ],
]

GetAlias

$result = $client->getAlias([/* ... */]);
$promise = $client->getAliasAsync([/* ... */]);

Returns details about a Lambda function alias.

Parameter Syntax

$result = $client->getAlias([
    'FunctionName' => '<string>', // REQUIRED
    'Name' => '<string>', // REQUIRED
]);

Parameter Details

Members
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.

Name
Required: Yes
Type: string

The name 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.

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 get a Lambda function alias

The following example returns details about an alias named BLUE for a function named my-function

$result = $client->getAlias([
    'FunctionName' => 'my-function',
    'Name' => 'BLUE',
]);

Result syntax:

[
    'AliasArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function:BLUE',
    'Description' => 'Production environment BLUE.',
    'FunctionVersion' => '3',
    'Name' => 'BLUE',
    'RevisionId' => '594f41fb-xmpl-4c20-95c7-6ca5f2a92c93',
]

GetCapacityProvider

$result = $client->getCapacityProvider([/* ... */]);
$promise = $client->getCapacityProviderAsync([/* ... */]);

Retrieves information about a specific capacity provider, including its configuration, state, and associated resources.

Parameter Syntax

$result = $client->getCapacityProvider([
    'CapacityProviderName' => '<string>', // REQUIRED
]);

Parameter Details

Members
CapacityProviderName
Required: Yes
Type: string

The name of the capacity provider to retrieve.

Result Syntax

[
    'CapacityProvider' => [
        'CapacityProviderArn' => '<string>',
        'CapacityProviderScalingConfig' => [
            'MaxVCpuCount' => <integer>,
            'ScalingMode' => 'Auto|Manual',
            'ScalingPolicies' => [
                [
                    'PredefinedMetricType' => 'LambdaCapacityProviderAverageCPUUtilization',
                    'TargetValue' => <float>,
                ],
                // ...
            ],
        ],
        'InstanceRequirements' => [
            'AllowedInstanceTypes' => ['<string>', ...],
            'Architectures' => ['<string>', ...],
            'ExcludedInstanceTypes' => ['<string>', ...],
        ],
        'KmsKeyArn' => '<string>',
        'LastModified' => '<string>',
        'PermissionsConfig' => [
            'CapacityProviderOperatorRoleArn' => '<string>',
        ],
        'State' => 'Pending|Active|Failed|Deleting',
        'VpcConfig' => [
            'SecurityGroupIds' => ['<string>', ...],
            'SubnetIds' => ['<string>', ...],
        ],
    ],
]

Result Details

Members
CapacityProvider
Required: Yes
Type: CapacityProvider structure

Information about the capacity provider, including its configuration and current state.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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.

GetCodeSigningConfig

$result = $client->getCodeSigningConfig([/* ... */]);
$promise = $client->getCodeSigningConfigAsync([/* ... */]);

Returns information about the specified code signing configuration.

Parameter Syntax

$result = $client->getCodeSigningConfig([
    'CodeSigningConfigArn' => '<string>', // REQUIRED
]);

Parameter Details

Members
CodeSigningConfigArn
Required: Yes
Type: string

The The Amazon Resource Name (ARN) of 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.

ResourceNotFoundException:

The resource specified in the request does not exist.

GetDurableExecution

$result = $client->getDurableExecution([/* ... */]);
$promise = $client->getDurableExecutionAsync([/* ... */]);

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.

Parameter Syntax

$result = $client->getDurableExecution([
    'DurableExecutionArn' => '<string>', // REQUIRED
]);

Parameter Details

Members
DurableExecutionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the durable execution.

Result Syntax

[
    'DurableExecutionArn' => '<string>',
    'DurableExecutionName' => '<string>',
    'EndTimestamp' => <DateTime>,
    'Error' => [
        'ErrorData' => '<string>',
        'ErrorMessage' => '<string>',
        'ErrorType' => '<string>',
        'StackTrace' => ['<string>', ...],
    ],
    'FunctionArn' => '<string>',
    'InputPayload' => '<string>',
    'Result' => '<string>',
    'StartTimestamp' => <DateTime>,
    'Status' => 'RUNNING|SUCCEEDED|FAILED|TIMED_OUT|STOPPED',
    'TraceHeader' => [
        'XAmznTraceId' => '<string>',
    ],
    'Version' => '<string>',
]

Result Details

Members
DurableExecutionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the durable execution.

DurableExecutionName
Required: Yes
Type: string

The name of the durable execution. This is either the name you provided when invoking the function, or a system-generated unique identifier if no name was provided.

EndTimestamp
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time when the durable execution ended, in Unix timestamp format. This field is only present if the execution has completed (status is SUCCEEDED, FAILED, TIMED_OUT, or STOPPED).

Error
Type: ErrorObject structure

Error information if the durable execution failed. This field is only present when the execution status is FAILED, TIMED_OUT, or STOPPED. The combined size of all error fields is limited to 256 KB.

FunctionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the Lambda function that was invoked to start this durable execution.

InputPayload
Type: string

The JSON input payload that was provided when the durable execution was started. For asynchronous invocations, this is limited to 256 KB. For synchronous invocations, this can be up to 6 MB.

Result
Type: string

The JSON result returned by the durable execution if it completed successfully. This field is only present when the execution status is SUCCEEDED. The result is limited to 256 KB.

StartTimestamp
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time when the durable execution started, in Unix timestamp format.

Status
Required: Yes
Type: string

The current status of the durable execution. Valid values are RUNNING, SUCCEEDED, FAILED, TIMED_OUT, and STOPPED.

TraceHeader
Type: TraceHeader structure

The trace headers associated with the durable execution.

Version
Type: string

The version of the Lambda function that was invoked for this durable execution. This ensures that all replays during the execution use the same function version.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

ServiceException:

The Lambda service encountered an internal error.

ResourceNotFoundException:

The resource specified in the request does not exist.

GetDurableExecutionHistory

$result = $client->getDurableExecutionHistory([/* ... */]);
$promise = $client->getDurableExecutionHistoryAsync([/* ... */]);

Retrieves the execution history for a durable execution, showing all the steps, callbacks, and events that occurred during the execution. This provides a detailed audit trail of the execution's progress over time.

The history is available while the execution is running and for a retention period after it completes (1-90 days, default 30 days). You can control whether to include execution data such as step results and callback payloads.

Parameter Syntax

$result = $client->getDurableExecutionHistory([
    'DurableExecutionArn' => '<string>', // REQUIRED
    'IncludeExecutionData' => true || false,
    'Marker' => '<string>',
    'MaxItems' => <integer>,
    'ReverseOrder' => true || false,
]);

Parameter Details

Members
DurableExecutionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the durable execution.

IncludeExecutionData
Type: boolean

Specifies whether to include execution data such as step results and callback payloads in the history events. Set to true to include data, or false to exclude it for a more compact response. The default is true.

Marker
Type: string

If NextMarker was returned from a previous request, use this value to retrieve the next page of results. Each pagination token expires after 24 hours.

MaxItems
Type: int

The maximum number of history events to return per call. You can use Marker to retrieve additional pages of results. The default is 100 and the maximum allowed is 1000. A value of 0 uses the default.

ReverseOrder
Type: boolean

When set to true, returns the history events in reverse chronological order (newest first). By default, events are returned in chronological order (oldest first).

Result Syntax

[
    'Events' => [
        [
            'CallbackFailedDetails' => [
                'Error' => [
                    'Payload' => [
                        'ErrorData' => '<string>',
                        'ErrorMessage' => '<string>',
                        'ErrorType' => '<string>',
                        'StackTrace' => ['<string>', ...],
                    ],
                    'Truncated' => true || false,
                ],
            ],
            'CallbackStartedDetails' => [
                'CallbackId' => '<string>',
                'HeartbeatTimeout' => <integer>,
                'Timeout' => <integer>,
            ],
            'CallbackSucceededDetails' => [
                'Result' => [
                    'Payload' => '<string>',
                    'Truncated' => true || false,
                ],
            ],
            'CallbackTimedOutDetails' => [
                'Error' => [
                    'Payload' => [
                        'ErrorData' => '<string>',
                        'ErrorMessage' => '<string>',
                        'ErrorType' => '<string>',
                        'StackTrace' => ['<string>', ...],
                    ],
                    'Truncated' => true || false,
                ],
            ],
            'ChainedInvokeFailedDetails' => [
                'Error' => [
                    'Payload' => [
                        'ErrorData' => '<string>',
                        'ErrorMessage' => '<string>',
                        'ErrorType' => '<string>',
                        'StackTrace' => ['<string>', ...],
                    ],
                    'Truncated' => true || false,
                ],
            ],
            'ChainedInvokeStartedDetails' => [
                'DurableExecutionArn' => '<string>',
                'ExecutedVersion' => '<string>',
                'FunctionName' => '<string>',
                'Input' => [
                    'Payload' => '<string>',
                    'Truncated' => true || false,
                ],
                'TenantId' => '<string>',
            ],
            'ChainedInvokeStoppedDetails' => [
                'Error' => [
                    'Payload' => [
                        'ErrorData' => '<string>',
                        'ErrorMessage' => '<string>',
                        'ErrorType' => '<string>',
                        'StackTrace' => ['<string>', ...],
                    ],
                    'Truncated' => true || false,
                ],
            ],
            'ChainedInvokeSucceededDetails' => [
                'Result' => [
                    'Payload' => '<string>',
                    'Truncated' => true || false,
                ],
            ],
            'ChainedInvokeTimedOutDetails' => [
                'Error' => [
                    'Payload' => [
                        'ErrorData' => '<string>',
                        'ErrorMessage' => '<string>',
                        'ErrorType' => '<string>',
                        'StackTrace' => ['<string>', ...],
                    ],
                    'Truncated' => true || false,
                ],
            ],
            'ContextFailedDetails' => [
                'Error' => [
                    'Payload' => [
                        'ErrorData' => '<string>',
                        'ErrorMessage' => '<string>',
                        'ErrorType' => '<string>',
                        'StackTrace' => ['<string>', ...],
                    ],
                    'Truncated' => true || false,
                ],
            ],
            'ContextStartedDetails' => [
            ],
            'ContextSucceededDetails' => [
                'Result' => [
                    'Payload' => '<string>',
                    'Truncated' => true || false,
                ],
            ],
            'EventId' => <integer>,
            'EventTimestamp' => <DateTime>,
            'EventType' => 'ExecutionStarted|ExecutionSucceeded|ExecutionFailed|ExecutionTimedOut|ExecutionStopped|ContextStarted|ContextSucceeded|ContextFailed|WaitStarted|WaitSucceeded|WaitCancelled|StepStarted|StepSucceeded|StepFailed|ChainedInvokeStarted|ChainedInvokeSucceeded|ChainedInvokeFailed|ChainedInvokeTimedOut|ChainedInvokeStopped|CallbackStarted|CallbackSucceeded|CallbackFailed|CallbackTimedOut|InvocationCompleted',
            'ExecutionFailedDetails' => [
                'Error' => [
                    'Payload' => [
                        'ErrorData' => '<string>',
                        'ErrorMessage' => '<string>',
                        'ErrorType' => '<string>',
                        'StackTrace' => ['<string>', ...],
                    ],
                    'Truncated' => true || false,
                ],
            ],
            'ExecutionStartedDetails' => [
                'ExecutionTimeout' => <integer>,
                'Input' => [
                    'Payload' => '<string>',
                    'Truncated' => true || false,
                ],
            ],
            'ExecutionStoppedDetails' => [
                'Error' => [
                    'Payload' => [
                        'ErrorData' => '<string>',
                        'ErrorMessage' => '<string>',
                        'ErrorType' => '<string>',
                        'StackTrace' => ['<string>', ...],
                    ],
                    'Truncated' => true || false,
                ],
            ],
            'ExecutionSucceededDetails' => [
                'Result' => [
                    'Payload' => '<string>',
                    'Truncated' => true || false,
                ],
            ],
            'ExecutionTimedOutDetails' => [
                'Error' => [
                    'Payload' => [
                        'ErrorData' => '<string>',
                        'ErrorMessage' => '<string>',
                        'ErrorType' => '<string>',
                        'StackTrace' => ['<string>', ...],
                    ],
                    'Truncated' => true || false,
                ],
            ],
            'Id' => '<string>',
            'InvocationCompletedDetails' => [
                'EndTimestamp' => <DateTime>,
                'Error' => [
                    'Payload' => [
                        'ErrorData' => '<string>',
                        'ErrorMessage' => '<string>',
                        'ErrorType' => '<string>',
                        'StackTrace' => ['<string>', ...],
                    ],
                    'Truncated' => true || false,
                ],
                'RequestId' => '<string>',
                'StartTimestamp' => <DateTime>,
            ],
            'Name' => '<string>',
            'ParentId' => '<string>',
            'StepFailedDetails' => [
                'Error' => [
                    'Payload' => [
                        'ErrorData' => '<string>',
                        'ErrorMessage' => '<string>',
                        'ErrorType' => '<string>',
                        'StackTrace' => ['<string>', ...],
                    ],
                    'Truncated' => true || false,
                ],
                'RetryDetails' => [
                    'CurrentAttempt' => <integer>,
                    'NextAttemptDelaySeconds' => <integer>,
                ],
            ],
            'StepStartedDetails' => [
            ],
            'StepSucceededDetails' => [
                'Result' => [
                    'Payload' => '<string>',
                    'Truncated' => true || false,
                ],
                'RetryDetails' => [
                    'CurrentAttempt' => <integer>,
                    'NextAttemptDelaySeconds' => <integer>,
                ],
            ],
            'SubType' => '<string>',
            'WaitCancelledDetails' => [
                'Error' => [
                    'Payload' => [
                        'ErrorData' => '<string>',
                        'ErrorMessage' => '<string>',
                        'ErrorType' => '<string>',
                        'StackTrace' => ['<string>', ...],
                    ],
                    'Truncated' => true || false,
                ],
            ],
            'WaitStartedDetails' => [
                'Duration' => <integer>,
                'ScheduledEndTimestamp' => <DateTime>,
            ],
            'WaitSucceededDetails' => [
                'Duration' => <integer>,
            ],
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
Events
Required: Yes
Type: Array of Event structures

An array of execution history events, ordered chronologically unless ReverseOrder is set to true. Each event represents a significant occurrence during the execution, such as step completion or callback resolution.

NextMarker
Type: string

If present, indicates that more history events are available. Use this value as the Marker parameter in a subsequent request to retrieve the next page of results.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

ServiceException:

The Lambda service encountered an internal error.

ResourceNotFoundException:

The resource specified in the request does not exist.

GetDurableExecutionState

$result = $client->getDurableExecutionState([/* ... */]);
$promise = $client->getDurableExecutionStateAsync([/* ... */]);

Retrieves the current execution state required for the replay process during durable function execution. This API is used by the Lambda durable functions SDK to get state information needed for replay. You typically don't need to call this API directly as the SDK handles state management automatically.

The response contains operations ordered by start sequence number in ascending order. Completed operations with children don't include child operation details since they don't need to be replayed.

Parameter Syntax

$result = $client->getDurableExecutionState([
    'CheckpointToken' => '<string>', // REQUIRED
    'DurableExecutionArn' => '<string>', // REQUIRED
    'Marker' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
CheckpointToken
Required: Yes
Type: string

A checkpoint token that identifies the current state of the execution. This token is provided by the Lambda runtime and ensures that state retrieval is consistent with the current execution context.

DurableExecutionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the durable execution.

Marker
Type: string

If NextMarker was returned from a previous request, use this value to retrieve the next page of operations. Each pagination token expires after 24 hours.

MaxItems
Type: int

The maximum number of operations to return per call. You can use Marker to retrieve additional pages of results. The default is 100 and the maximum allowed is 1000. A value of 0 uses the default.

Result Syntax

[
    '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
NextMarker
Type: string

If present, indicates that more operations are available. Use this value as the Marker parameter in a subsequent request to retrieve the next page of results.

Operations
Required: Yes
Type: Array of Operation structures

An array of operations that represent the current state of the durable execution. Operations are ordered by their start sequence number in ascending order and include information needed for replay processing.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

ServiceException:

The Lambda service encountered an internal error.

GetEventSourceMapping

$result = $client->getEventSourceMapping([/* ... */]);
$promise = $client->getEventSourceMappingAsync([/* ... */]);

Returns details about an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.

Parameter Syntax

$result = $client->getEventSourceMapping([
    'UUID' => '<string>', // REQUIRED
]);

Parameter Details

Members
UUID
Required: Yes
Type: string

The identifier of the event source mapping.

Result Syntax

[
    'AmazonManagedKafkaEventSourceConfig' => [
        'ConsumerGroupId' => '<string>',
        'SchemaRegistryConfig' => [
            'AccessConfigs' => [
                [
                    'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE',
                    '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>',
    '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>',
        'SchemaRegistryConfig' => [
            'AccessConfigs' => [
                [
                    'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE',
                    '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',
            'URI' => '<string>',
        ],
        // ...
    ],
    'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP',
    'StartingPositionTimestamp' => <DateTime>,
    'State' => '<string>',
    'StateTransitionReason' => '<string>',
    'Topics' => ['<string>', ...],
    'TumblingWindowInSeconds' => <integer>,
    'UUID' => '<string>',
]

Result Details

Members
AmazonManagedKafkaEventSourceConfig

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 BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to 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 null in the response of ListEventSourceMapping API calls. You can view this field in plaintext in the response of GetEventSourceMapping and DeleteEventSourceMapping calls if you have kms:Decrypt permissions 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.

MaximumBatchingWindowInSeconds
Type: int

The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure MaximumBatchingWindowInSeconds to 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 MaximumBatchingWindowInSeconds in 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 BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to 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

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

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_TIMESTAMP is 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 StartingPosition set to AT_TIMESTAMP, the time from which to start reading. StartingPositionTimestamp cannot 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, or Deleting.

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.

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 get a Lambda function's event source mapping

The following example returns details about an event source mapping. To get a mapping's UUID, use ListEventSourceMappings.

$result = $client->getEventSourceMapping([
    'UUID' => '14e0db71-xmpl-4eb5-b481-8945cf9d10c2',
]);

Result syntax:

[
    'BatchSize' => 500,
    'BisectBatchOnFunctionError' => ,
    'DestinationConfig' => [
    ],
    'EventSourceArn' => 'arn:aws:sqs:us-east-2:123456789012:mySQSqueue',
    'FunctionArn' => 'arn:aws:lambda:us-east-2:123456789012:function:myFunction',
    'LastModified' => ,
    'LastProcessingResult' => 'No records processed',
    'MaximumRecordAgeInSeconds' => 604800,
    'MaximumRetryAttempts' => 10000,
    'State' => 'Creating',
    'StateTransitionReason' => 'User action',
    'UUID' => '14e0db71-xmpl-4eb5-b481-8945cf9d10c2',
]

GetFunction

$result = $client->getFunction([/* ... */]);
$promise = $client->getFunctionAsync([/* ... */]);

Returns information about the function or function version, with a link to download the deployment package that's valid for 10 minutes. If you specify a function version, only details that are specific to that version are returned.

Parameter Syntax

$result = $client->getFunction([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>',
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function, version, or alias.

Name formats

  • Function namemy-function (name-only), my-function:v1 (with alias).

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Qualifier
Type: string

Specify a version or alias to get details about a published version of the function.

Result Syntax

[
    'Code' => [
        'ImageUri' => '<string>',
        'Location' => '<string>',
        'RepositoryType' => '<string>',
        'ResolvedImageUri' => '<string>',
        'SourceKMSKeyArn' => '<string>',
    ],
    'Concurrency' => [
        'ReservedConcurrentExecutions' => <integer>,
    ],
    'Configuration' => [
        'Architectures' => ['<string>', ...],
        'CapacityProviderConfig' => [
            'LambdaManagedInstancesCapacityProviderConfig' => [
                'CapacityProviderArn' => '<string>',
                'ExecutionEnvironmentMemoryGiBPerVCpu' => <float>,
                'PerExecutionEnvironmentMaxConcurrency' => <integer>,
            ],
        ],
        'CodeSha256' => '<string>',
        'CodeSize' => <integer>,
        'ConfigSha256' => '<string>',
        'DeadLetterConfig' => [
            'TargetArn' => '<string>',
        ],
        'Description' => '<string>',
        'DurableConfig' => [
            'ExecutionTimeout' => <integer>,
            'RetentionPeriodInDays' => <integer>,
        ],
        'Environment' => [
            'Error' => [
                'ErrorCode' => '<string>',
                'Message' => '<string>',
            ],
            'Variables' => ['<string>', ...],
        ],
        'EphemeralStorage' => [
            'Size' => <integer>,
        ],
        'FileSystemConfigs' => [
            [
                'Arn' => '<string>',
                'LocalMountPath' => '<string>',
            ],
            // ...
        ],
        '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|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
        '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|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|python3.9|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2|nodejs18.x|python3.10|java17|ruby3.2|ruby3.3|ruby3.4|python3.11|nodejs20.x|provided.al2023|python3.12|java21|python3.13|nodejs22.x|nodejs24.x|python3.14|java25',
        '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|DrainingDurableExecutions|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
        'TenancyConfig' => [
            'TenantIsolationMode' => 'PER_TENANT',
        ],
        'Timeout' => <integer>,
        'TracingConfig' => [
            'Mode' => 'Active|PassThrough',
        ],
        'Version' => '<string>',
        'VpcConfig' => [
            'Ipv6AllowedForDualStack' => true || false,
            'SecurityGroupIds' => ['<string>', ...],
            'SubnetIds' => ['<string>', ...],
            'VpcId' => '<string>',
        ],
    ],
    'Tags' => ['<string>', ...],
    'TagsError' => [
        'ErrorCode' => '<string>',
        'Message' => '<string>',
    ],
]

Result Details

Members
Code
Type: FunctionCodeLocation structure

The deployment package of the function or version.

Concurrency
Type: Concurrency structure

The function's reserved concurrency.

Configuration
Type: FunctionConfiguration structure

The configuration of the function or version.

Tags
Type: Associative array of custom strings keys (TagKey) to strings

The function's tags. Lambda returns tag data only if you have explicit allow permissions for lambda:ListTags.

TagsError
Type: TagsError structure

An object that contains details about an error related to retrieving tags.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 get a Lambda function

The following example returns code and configuration details for version 1 of a function named my-function.

$result = $client->getFunction([
    'FunctionName' => 'my-function',
    'Qualifier' => '1',
]);

Result syntax:

[
    'Code' => [
        'Location' => 'https://awslambda-us-west-2-tasks.s3.us-west-2.amazonaws.com/snapshots/123456789012/my-function-e7d9d1ed-xmpl-4f79-904a-4b87f2681f30?versionId=sH3TQwBOaUy...',
        'RepositoryType' => 'S3',
    ],
    'Configuration' => [
        'CodeSha256' => 'YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=',
        'CodeSize' => 5797206,
        'Description' => 'Process image objects from Amazon S3.',
        'DurableConfig' => [
            'ExecutionTimeout' => 31622400,
            'RetentionPeriodInDays' => 30,
        ],
        'Environment' => [
            'Variables' => [
                'BUCKET' => 'my-bucket-1xpuxmplzrlbh',
                'PREFIX' => 'inbound',
            ],
        ],
        'FunctionArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function',
        'FunctionName' => 'my-function',
        'Handler' => 'index.handler',
        'KMSKeyArn' => 'arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966',
        'LastModified' => '2020-04-10T19:06:32.563+0000',
        'LastUpdateStatus' => 'Successful',
        'MemorySize' => 256,
        'RevisionId' => 'b75dcd81-xmpl-48a8-a75a-93ba8b5b9727',
        'Role' => 'arn:aws:iam::123456789012:role/lambda-role',
        'Runtime' => 'nodejs12.x',
        'State' => 'Active',
        'Timeout' => 15,
        'TracingConfig' => [
            'Mode' => 'Active',
        ],
        'Version' => '$LATEST',
    ],
    'Tags' => [
        'DEPARTMENT' => 'Assets',
    ],
]

GetFunctionCodeSigningConfig

$result = $client->getFunctionCodeSigningConfig([/* ... */]);
$promise = $client->getFunctionCodeSigningConfigAsync([/* ... */]);

Returns the code signing configuration for the specified function.

Parameter Syntax

$result = $client->getFunctionCodeSigningConfig([
    'FunctionName' => '<string>', // REQUIRED
]);

Parameter Details

Members
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.

Result Syntax

[
    'CodeSigningConfigArn' => '<string>',
    'FunctionName' => '<string>',
]

Result Details

Members
CodeSigningConfigArn
Required: Yes
Type: string

The The Amazon Resource Name (ARN) of the code signing configuration.

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.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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.

GetFunctionConcurrency

$result = $client->getFunctionConcurrency([/* ... */]);
$promise = $client->getFunctionConcurrencyAsync([/* ... */]);

Returns details about the reserved concurrency configuration for a function. To set a concurrency limit for a function, use PutFunctionConcurrency.

Parameter Syntax

$result = $client->getFunctionConcurrency([
    'FunctionName' => '<string>', // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Result Syntax

[
    'ReservedConcurrentExecutions' => <integer>,
]

Result Details

Members
ReservedConcurrentExecutions
Type: int

The number of simultaneous executions that are reserved for the function.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 get the reserved concurrency setting for a function

The following example returns the reserved concurrency setting for a function named my-function.

$result = $client->getFunctionConcurrency([
    'FunctionName' => 'my-function',
]);

Result syntax:

[
    'ReservedConcurrentExecutions' => 250,
]

GetFunctionConfiguration

$result = $client->getFunctionConfiguration([/* ... */]);
$promise = $client->getFunctionConfigurationAsync([/* ... */]);

Returns the version-specific settings of a Lambda function or version. The output includes only options that can vary between versions of a function. To modify these settings, use UpdateFunctionConfiguration.

To get all of a function's details, including function-level settings, use GetFunction.

Parameter Syntax

$result = $client->getFunctionConfiguration([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>',
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function, version, or alias.

Name formats

  • Function namemy-function (name-only), my-function:v1 (with alias).

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Qualifier
Type: string

Specify a version or alias to get details about a published version of the function.

Result Syntax

[
    'Architectures' => ['<string>', ...],
    'CapacityProviderConfig' => [
        'LambdaManagedInstancesCapacityProviderConfig' => [
            'CapacityProviderArn' => '<string>',
            'ExecutionEnvironmentMemoryGiBPerVCpu' => <float>,
            'PerExecutionEnvironmentMaxConcurrency' => <integer>,
        ],
    ],
    'CodeSha256' => '<string>',
    'CodeSize' => <integer>,
    'ConfigSha256' => '<string>',
    'DeadLetterConfig' => [
        'TargetArn' => '<string>',
    ],
    'Description' => '<string>',
    'DurableConfig' => [
        'ExecutionTimeout' => <integer>,
        'RetentionPeriodInDays' => <integer>,
    ],
    'Environment' => [
        'Error' => [
            'ErrorCode' => '<string>',
            'Message' => '<string>',
        ],
        'Variables' => ['<string>', ...],
    ],
    'EphemeralStorage' => [
        'Size' => <integer>,
    ],
    'FileSystemConfigs' => [
        [
            'Arn' => '<string>',
            'LocalMountPath' => '<string>',
        ],
        // ...
    ],
    '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|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
    '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|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|python3.9|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2|nodejs18.x|python3.10|java17|ruby3.2|ruby3.3|ruby3.4|python3.11|nodejs20.x|provided.al2023|python3.12|java21|python3.13|nodejs22.x|nodejs24.x|python3.14|java25',
    '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|DrainingDurableExecutions|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
    '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
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 /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).

FileSystemConfigs
Type: Array of FileSystemConfig structures

Connection settings for an Amazon EFS 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 Successful after 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 Image for container image and set Zip for .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.

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 ApplyOn to PublishedVersions to 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.

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 get a Lambda function's event source mapping

The following example returns and configuration details for version 1 of a function named my-function.

$result = $client->getFunctionConfiguration([
    'FunctionName' => 'my-function',
    'Qualifier' => '1',
]);

Result syntax:

[
    'CodeSha256' => 'YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=',
    'CodeSize' => 5797206,
    'Description' => 'Process image objects from Amazon S3.',
    'DurableConfig' => [
        'ExecutionTimeout' => 31622400,
        'RetentionPeriodInDays' => 30,
    ],
    'Environment' => [
        'Variables' => [
            'BUCKET' => 'my-bucket-1xpuxmplzrlbh',
            'PREFIX' => 'inbound',
        ],
    ],
    'FunctionArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function',
    'FunctionName' => 'my-function',
    'Handler' => 'index.handler',
    'KMSKeyArn' => 'arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966',
    'LastModified' => '2020-04-10T19:06:32.563+0000',
    'LastUpdateStatus' => 'Successful',
    'MemorySize' => 256,
    'RevisionId' => 'b75dcd81-xmpl-48a8-a75a-93ba8b5b9727',
    'Role' => 'arn:aws:iam::123456789012:role/lambda-role',
    'Runtime' => 'nodejs12.x',
    'State' => 'Active',
    'Timeout' => 15,
    'TracingConfig' => [
        'Mode' => 'Active',
    ],
    'Version' => '$LATEST',
]

GetFunctionEventInvokeConfig

$result = $client->getFunctionEventInvokeConfig([/* ... */]);
$promise = $client->getFunctionEventInvokeConfigAsync([/* ... */]);

Retrieves the configuration for asynchronous invocation for a function, version, or alias.

To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

Parameter Syntax

$result = $client->getFunctionEventInvokeConfig([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>',
]);

Parameter Details

Members
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.

Qualifier
Type: string

A version number or alias name.

Result Syntax

[
    'DestinationConfig' => [
        'OnFailure' => [
            'Destination' => '<string>',
        ],
        'OnSuccess' => [
            'Destination' => '<string>',
        ],
    ],
    'FunctionArn' => '<string>',
    'LastModified' => <DateTime>,
    'MaximumEventAgeInSeconds' => <integer>,
    'MaximumRetryAttempts' => <integer>,
]

Result Details

Members
DestinationConfig
Type: DestinationConfig structure

A destination for events after they have been sent to a function for processing.

Destinations

  • Function - The Amazon Resource Name (ARN) of a Lambda function.

  • Queue - The ARN of a standard SQS queue.

  • Bucket - The ARN of an Amazon S3 bucket.

  • Topic - The ARN of a standard SNS topic.

  • Event Bus - The ARN of an Amazon EventBridge event bus.

S3 buckets are supported only for on-failure destinations. To retain records of successful invocations, use another destination type.

FunctionArn
Type: string

The Amazon Resource Name (ARN) of the function.

LastModified
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time that the configuration was last updated.

MaximumEventAgeInSeconds
Type: int

The maximum age of a request that Lambda sends to a function for processing.

MaximumRetryAttempts
Type: int

The maximum number of times to retry when the function returns an error.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 get an asynchronous invocation configuration

The following example returns the asynchronous invocation configuration for the BLUE alias of a function named my-function.

$result = $client->getFunctionEventInvokeConfig([
    'FunctionName' => 'my-function',
    'Qualifier' => 'BLUE',
]);

Result syntax:

[
    'DestinationConfig' => [
        'OnFailure' => [
            'Destination' => 'arn:aws:sqs:us-east-2:123456789012:failed-invocations',
        ],
        'OnSuccess' => [
        ],
    ],
    'FunctionArn' => 'arn:aws:lambda:us-east-2:123456789012:function:my-function:BLUE',
    'LastModified' => ,
    'MaximumEventAgeInSeconds' => 3600,
    'MaximumRetryAttempts' => 0,
]

GetFunctionRecursionConfig

$result = $client->getFunctionRecursionConfig([/* ... */]);
$promise = $client->getFunctionRecursionConfigAsync([/* ... */]);

Returns your function's recursive loop detection configuration.

Parameter Syntax

$result = $client->getFunctionRecursionConfig([
    'FunctionName' => '<string>', // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name of the function.

Result Syntax

[
    'RecursiveLoop' => 'Allow|Terminate',
]

Result Details

Members
RecursiveLoop
Type: string

If your function's recursive loop detection configuration is Allow, Lambda doesn't take any action when it detects your function being invoked as part of a recursive loop.

If your function's recursive loop detection configuration is Terminate, Lambda stops your function being invoked and notifies you when it detects your function being invoked as part of a recursive loop.

By default, Lambda sets your function's configuration to Terminate. You can update this configuration using the PutFunctionRecursionConfig action.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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.

GetFunctionScalingConfig

$result = $client->getFunctionScalingConfig([/* ... */]);
$promise = $client->getFunctionScalingConfigAsync([/* ... */]);

Retrieves the scaling configuration for a Lambda Managed Instances function.

Parameter Syntax

$result = $client->getFunctionScalingConfig([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>', // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Qualifier
Required: Yes
Type: string

Specify a version or alias to get the scaling configuration for a published version of the function.

Result Syntax

[
    'AppliedFunctionScalingConfig' => [
        'MaxExecutionEnvironments' => <integer>,
        'MinExecutionEnvironments' => <integer>,
    ],
    'FunctionArn' => '<string>',
    'RequestedFunctionScalingConfig' => [
        'MaxExecutionEnvironments' => <integer>,
        'MinExecutionEnvironments' => <integer>,
    ],
]

Result Details

Members
AppliedFunctionScalingConfig
Type: FunctionScalingConfig structure

The scaling configuration that is currently applied to the function. This represents the actual scaling settings in effect.

FunctionArn
Type: string

The Amazon Resource Name (ARN) of the function.

RequestedFunctionScalingConfig
Type: FunctionScalingConfig structure

The scaling configuration that was requested for the function.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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.

GetFunctionUrlConfig

$result = $client->getFunctionUrlConfig([/* ... */]);
$promise = $client->getFunctionUrlConfigAsync([/* ... */]);

Returns details about a Lambda function URL.

Parameter Syntax

$result = $client->getFunctionUrlConfig([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>',
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Qualifier
Type: string

The alias name.

Result Syntax

[
    'AuthType' => 'NONE|AWS_IAM',
    'Cors' => [
        'AllowCredentials' => true || false,
        'AllowHeaders' => ['<string>', ...],
        'AllowMethods' => ['<string>', ...],
        'AllowOrigins' => ['<string>', ...],
        'ExposeHeaders' => ['<string>', ...],
        'MaxAge' => <integer>,
    ],
    'CreationTime' => '<string>',
    'FunctionArn' => '<string>',
    'FunctionUrl' => '<string>',
    'InvokeMode' => 'BUFFERED|RESPONSE_STREAM',
    'LastModifiedTime' => '<string>',
]

Result Details

Members
AuthType
Required: Yes
Type: string

The type of authentication that your function URL uses. Set to AWS_IAM if you want to restrict access to authenticated users only. Set to NONE if you want to bypass IAM authentication to create a public endpoint. For more information, see Control access to Lambda function URLs.

Cors
Type: Cors structure

The cross-origin resource sharing (CORS) settings for your function URL.

CreationTime
Required: Yes
Type: string

When the function URL was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

FunctionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of your function.

FunctionUrl
Required: Yes
Type: string

The HTTP URL endpoint for your function.

InvokeMode
Type: string

Use one of the following options:

  • BUFFERED – This is the default option. Lambda invokes your function using the Invoke API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB.

  • RESPONSE_STREAM – Your function streams payload results as they become available. Lambda invokes your function using the InvokeWithResponseStream API operation. The maximum response payload size is 200 MB.

LastModifiedTime
Required: Yes
Type: string

When the function URL configuration was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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.

GetLayerVersion

$result = $client->getLayerVersion([/* ... */]);
$promise = $client->getLayerVersionAsync([/* ... */]);

Returns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes.

Parameter Syntax

$result = $client->getLayerVersion([
    'LayerName' => '<string>', // REQUIRED
    'VersionNumber' => <integer>, // REQUIRED
]);

Parameter Details

Members
LayerName
Required: Yes
Type: string

The name or Amazon Resource Name (ARN) of the layer.

VersionNumber
Required: Yes
Type: long (int|float)

The version number.

Result Syntax

[
    'CompatibleArchitectures' => ['<string>', ...],
    'CompatibleRuntimes' => ['<string>', ...],
    'Content' => [
        'CodeSha256' => '<string>',
        'CodeSize' => <integer>,
        'Location' => '<string>',
        'SigningJobArn' => '<string>',
        'SigningProfileVersionArn' => '<string>',
    ],
    'CreatedDate' => '<string>',
    'Description' => '<string>',
    'LayerArn' => '<string>',
    'LayerVersionArn' => '<string>',
    'LicenseInfo' => '<string>',
    'Version' => <integer>,
]

Result Details

Members
CompatibleArchitectures
Type: Array of strings

A list of compatible instruction set architectures.

CompatibleRuntimes
Type: Array of strings

The layer's compatible runtimes.

The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.

For a list of all currently supported runtimes, see Supported runtimes.

Content
Type: LayerVersionContentOutput structure

Details about the layer version.

CreatedDate
Type: string

The date that the layer version was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

Description
Type: string

The description of the version.

LayerArn
Type: string

The ARN of the layer.

LayerVersionArn
Type: string

The ARN of the layer version.

LicenseInfo
Type: string

The layer's software license.

Version
Type: long (int|float)

The version number.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 get information about a Lambda layer version

The following example returns information for version 1 of a layer named my-layer.

$result = $client->getLayerVersion([
    'LayerName' => 'my-layer',
    'VersionNumber' => 1,
]);

Result syntax:

[
    'CompatibleRuntimes' => [
        'python3.6',
        'python3.7',
    ],
    'Content' => [
        'CodeSha256' => 'tv9jJO+rPbXUUXuRKi7CwHzKtLDkDRJLB3cC3Z/ouXo=',
        'CodeSize' => 169,
        'Location' => 'https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/123456789012/my-layer-4aaa2fbb-ff77-4b0a-ad92-5b78a716a96a?versionId=27iWyA73cCAYqyH...',
    ],
    'CreatedDate' => '2018-11-14T23:03:52.894+0000',
    'Description' => 'My Python layer',
    'LayerArn' => 'arn:aws:lambda:us-east-2:123456789012:layer:my-layer',
    'LayerVersionArn' => 'arn:aws:lambda:us-east-2:123456789012:layer:my-layer:1',
    'LicenseInfo' => 'MIT',
    'Version' => 1,
]

GetLayerVersionByArn

$result = $client->getLayerVersionByArn([/* ... */]);
$promise = $client->getLayerVersionByArnAsync([/* ... */]);

Returns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes.

Parameter Syntax

$result = $client->getLayerVersionByArn([
    'Arn' => '<string>', // REQUIRED
]);

Parameter Details

Members
Arn
Required: Yes
Type: string

The ARN of the layer version.

Result Syntax

[
    'CompatibleArchitectures' => ['<string>', ...],
    'CompatibleRuntimes' => ['<string>', ...],
    'Content' => [
        'CodeSha256' => '<string>',
        'CodeSize' => <integer>,
        'Location' => '<string>',
        'SigningJobArn' => '<string>',
        'SigningProfileVersionArn' => '<string>',
    ],
    'CreatedDate' => '<string>',
    'Description' => '<string>',
    'LayerArn' => '<string>',
    'LayerVersionArn' => '<string>',
    'LicenseInfo' => '<string>',
    'Version' => <integer>,
]

Result Details

Members
CompatibleArchitectures
Type: Array of strings

A list of compatible instruction set architectures.

CompatibleRuntimes
Type: Array of strings

The layer's compatible runtimes.

The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.

For a list of all currently supported runtimes, see Supported runtimes.

Content
Type: LayerVersionContentOutput structure

Details about the layer version.

CreatedDate
Type: string

The date that the layer version was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

Description
Type: string

The description of the version.

LayerArn
Type: string

The ARN of the layer.

LayerVersionArn
Type: string

The ARN of the layer version.

LicenseInfo
Type: string

The layer's software license.

Version
Type: long (int|float)

The version number.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 get information about a Lambda layer version

The following example returns information about the layer version with the specified Amazon Resource Name (ARN).

$result = $client->getLayerVersionByArn([
    'Arn' => 'arn:aws:lambda:ca-central-1:123456789012:layer:blank-python-lib:3',
]);

Result syntax:

[
    'CompatibleRuntimes' => [
        'python3.8',
    ],
    'Content' => [
        'CodeSha256' => '6x+xmpl/M3BnQUk7gS9sGmfeFsR/npojXoA3fZUv4eU=',
        'CodeSize' => 9529009,
        'Location' => 'https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/123456789012/blank-python-lib-e5212378-xmpl-44ee-8398-9d8ec5113949?versionId=WbZnvf...',
    ],
    'CreatedDate' => '2020-03-31T00:35:18.949+0000',
    'Description' => 'Dependencies for the blank-python sample app.',
    'LayerArn' => 'arn:aws:lambda:us-east-2:123456789012:layer:blank-python-lib',
    'LayerVersionArn' => 'arn:aws:lambda:us-east-2:123456789012:layer:blank-python-lib:3',
    'Version' => 3,
]

GetLayerVersionPolicy

$result = $client->getLayerVersionPolicy([/* ... */]);
$promise = $client->getLayerVersionPolicyAsync([/* ... */]);

Returns the permission policy for a version of an Lambda layer. For more information, see AddLayerVersionPermission.

Parameter Syntax

$result = $client->getLayerVersionPolicy([
    'LayerName' => '<string>', // REQUIRED
    'VersionNumber' => <integer>, // REQUIRED
]);

Parameter Details

Members
LayerName
Required: Yes
Type: string

The name or Amazon Resource Name (ARN) of the layer.

VersionNumber
Required: Yes
Type: long (int|float)

The version number.

Result Syntax

[
    'Policy' => '<string>',
    'RevisionId' => '<string>',
]

Result Details

Members
Policy
Type: string

The policy document.

RevisionId
Type: string

A unique identifier for the current revision of the policy.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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.

GetPolicy

$result = $client->getPolicy([/* ... */]);
$promise = $client->getPolicyAsync([/* ... */]);

Returns the resource-based IAM policy for a function, version, or alias.

Parameter Syntax

$result = $client->getPolicy([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>',
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function, version, or alias.

Name formats

  • Function namemy-function (name-only), my-function:v1 (with alias).

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Qualifier
Type: string

Specify a version or alias to get the policy for that resource.

Result Syntax

[
    'Policy' => '<string>',
    'RevisionId' => '<string>',
]

Result Details

Members
Policy
Type: string

The resource-based policy.

RevisionId
Type: string

A unique identifier for the current revision of the policy.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 retrieve a Lambda function policy

The following example returns the resource-based policy for version 1 of a Lambda function named my-function.

$result = $client->getPolicy([
    'FunctionName' => 'my-function',
    'Qualifier' => '1',
]);

Result syntax:

[
    'Policy' => '{"Version":"2012-10-17","Id":"default","Statement":[{"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::123456789012:root"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function:1"}]}',
    'RevisionId' => '4843f2f6-7c59-4fda-b484-afd0bc0e22b8',
]

GetProvisionedConcurrencyConfig

$result = $client->getProvisionedConcurrencyConfig([/* ... */]);
$promise = $client->getProvisionedConcurrencyConfigAsync([/* ... */]);

Retrieves the provisioned concurrency configuration for a function's alias or version.

Parameter Syntax

$result = $client->getProvisionedConcurrencyConfig([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>', // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Qualifier
Required: Yes
Type: string

The version number or alias name.

Result Syntax

[
    'AllocatedProvisionedConcurrentExecutions' => <integer>,
    'AvailableProvisionedConcurrentExecutions' => <integer>,
    'LastModified' => '<string>',
    'RequestedProvisionedConcurrentExecutions' => <integer>,
    'Status' => 'IN_PROGRESS|READY|FAILED',
    'StatusReason' => '<string>',
]

Result Details

Members
AllocatedProvisionedConcurrentExecutions
Type: int

The amount of provisioned concurrency allocated. When a weighted alias is used during linear and canary deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function versions.

AvailableProvisionedConcurrentExecutions
Type: int

The amount of provisioned concurrency available.

LastModified
Type: string

The date and time that a user last updated the configuration, in ISO 8601 format.

RequestedProvisionedConcurrentExecutions
Type: int

The amount of provisioned concurrency requested.

Status
Type: string

The status of the allocation process.

StatusReason
Type: string

For failed allocations, the reason that provisioned concurrency could not be allocated.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

ProvisionedConcurrencyConfigNotFoundException:

The specified configuration does not exist.

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 get a provisioned concurrency configuration

The following example returns details for the provisioned concurrency configuration for the BLUE alias of the specified function.

$result = $client->getProvisionedConcurrencyConfig([
    'FunctionName' => 'my-function',
    'Qualifier' => 'BLUE',
]);

Result syntax:

[
    'AllocatedProvisionedConcurrentExecutions' => 100,
    'AvailableProvisionedConcurrentExecutions' => 100,
    'LastModified' => '2019-12-31T20:28:49+0000',
    'RequestedProvisionedConcurrentExecutions' => 100,
    'Status' => 'READY',
]
Example 2: To view a provisioned concurrency configuration

The following example displays details for the provisioned concurrency configuration for the BLUE alias of the specified function.

$result = $client->getProvisionedConcurrencyConfig([
    'FunctionName' => 'my-function',
    'Qualifier' => 'BLUE',
]);

Result syntax:

[
    'AllocatedProvisionedConcurrentExecutions' => 100,
    'AvailableProvisionedConcurrentExecutions' => 100,
    'LastModified' => '2019-12-31T20:28:49+0000',
    'RequestedProvisionedConcurrentExecutions' => 100,
    'Status' => 'READY',
]

GetRuntimeManagementConfig

$result = $client->getRuntimeManagementConfig([/* ... */]);
$promise = $client->getRuntimeManagementConfigAsync([/* ... */]);

Retrieves the runtime management configuration for a function's version. If the runtime update mode is Manual, this includes the ARN of the runtime version and the runtime update mode. If the runtime update mode is Auto or Function update, this includes the runtime update mode and null is returned for the ARN. For more information, see Runtime updates.

Parameter Syntax

$result = $client->getRuntimeManagementConfig([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>',
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Qualifier
Type: string

Specify a version of the function. This can be $LATEST or a published version number. If no value is specified, the configuration for the $LATEST version is returned.

Result Syntax

[
    'FunctionArn' => '<string>',
    'RuntimeVersionArn' => '<string>',
    'UpdateRuntimeOn' => 'Auto|Manual|FunctionUpdate',
]

Result Details

Members
FunctionArn
Type: string

The Amazon Resource Name (ARN) of your function.

RuntimeVersionArn
Type: string

The ARN of the runtime the function is configured to use. If the runtime update mode is Manual, the ARN is returned, otherwise null is returned.

UpdateRuntimeOn
Type: string

The current runtime update mode of the function.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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.

Invoke

$result = $client->invoke([/* ... */]);
$promise = $client->invokeAsync([/* ... */]);

Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or asynchronously. By default, Lambda invokes your function synchronously (i.e. theInvocationType is RequestResponse). To invoke a function asynchronously, set InvocationType to Event. Lambda passes the ClientContext object to your function for synchronous invocations only.

For synchronous invocations, the maximum payload size is 6 MB. For asynchronous invocations, the maximum payload size is 1 MB.

For synchronous invocation, details about the function response, including errors, are included in the response body and headers. For either invocation type, you can find more information in the execution log and trace.

When an error occurs, your function may be invoked multiple times. Retry behavior varies by error type, client, event source, and invocation type. For example, if you invoke a function asynchronously and it returns an error, Lambda executes the function up to two more times. For more information, see Error handling and automatic retries in Lambda.

For asynchronous invocation, Lambda adds events to a queue before sending them to your function. If your function does not have enough capacity to keep up with the queue, events may be lost. Occasionally, your function may receive the same event multiple times, even if no error occurs. To retain events that were not processed, configure your function with a dead-letter queue.

The status code in the API response doesn't reflect function errors. Error codes are reserved for errors that prevent your function from executing, such as permissions errors, quota errors, or issues with your function's code and configuration. For example, Lambda returns TooManyRequestsException if running the function would cause you to exceed a concurrency limit at either the account level (ConcurrentInvocationLimitExceeded) or function level (ReservedFunctionConcurrentInvocationLimitExceeded).

For functions with a long timeout, your client might disconnect during synchronous invocation while it waits for a response. Configure your HTTP client, SDK, firewall, proxy, or operating system to allow for long connections with timeout or keep-alive settings.

This operation requires permission for the lambda:InvokeFunction action. For details on how to set up permissions for cross-account invocations, see Granting function access to other accounts.

Parameter Syntax

$result = $client->invoke([
    'ClientContext' => '<string>',
    'DurableExecutionName' => '<string>',
    'FunctionName' => '<string>', // REQUIRED
    'InvocationType' => 'Event|RequestResponse|DryRun',
    'LogType' => 'None|Tail',
    'Payload' => <string || resource || Psr\Http\Message\StreamInterface>,
    'Qualifier' => '<string>',
    'TenantId' => '<string>',
]);

Parameter Details

Members
ClientContext
Type: string

Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object. Lambda passes the ClientContext object to your function for synchronous invocations only.

DurableExecutionName
Type: string

Optional unique name for the durable execution. When you start your special function, you can give it a unique name to identify this specific execution. It's like giving a nickname to a task.

FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function, version, or alias.

Name formats

  • Function namemy-function (name-only), my-function:v1 (with alias).

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

InvocationType
Type: string

Choose from the following options.

  • RequestResponse (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.

  • Event – Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if one is configured). The API response only includes a status code.

  • DryRun – Validate parameter values and verify that the user or role has permission to invoke the function.

LogType
Type: string

Set to Tail to include the execution log in the response. Applies to synchronously invoked functions only.

Payload
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

The JSON that you want to provide to your Lambda function as input. The maximum payload size is 6 MB for synchronous invocations and 1 MB for asynchronous invocations.

You can enter the JSON directly. For example, --payload '{ "key": "value" }'. You can also specify a file path. For example, --payload file://payload.json.

Qualifier
Type: string

Specify a version or alias to invoke a published version of the function.

TenantId
Type: string

The identifier of the tenant in a multi-tenant Lambda function.

Result Syntax

[
    'DurableExecutionArn' => '<string>',
    'ExecutedVersion' => '<string>',
    'FunctionError' => '<string>',
    'LogResult' => '<string>',
    'Payload' => <string || resource || Psr\Http\Message\StreamInterface>,
    'StatusCode' => <integer>,
]

Result Details

Members
DurableExecutionArn
Type: string

The ARN of the durable execution that was started. This is returned when invoking a durable function and provides a unique identifier for tracking the execution.

ExecutedVersion
Type: string

The version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to.

FunctionError
Type: string

If present, indicates that an error occurred during function execution. Details about the error are included in the response payload.

LogResult
Type: string

The last 4 KB of the execution log, which is base64-encoded.

Payload
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

The response from the function, or an error object.

StatusCode
Type: int

The HTTP status code is in the 200 range for a successful request. For the RequestResponse invocation type, this status code is 200. For the Event invocation type, this status code is 202. For the DryRun invocation type, the status code is 204.

Errors

ResourceNotReadyException:

The function is inactive and its VPC connection is no longer available. Wait for the VPC connection to reestablish and try again.

InvalidSecurityGroupIDException:

The security group ID provided in the Lambda function VPC configuration is not valid.

SnapStartTimeoutException:

Lambda couldn't restore the snapshot within the timeout limit.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

EC2ThrottledException:

Amazon EC2 throttled Lambda during Lambda function initialization using the execution role provided for the function.

EFSMountConnectivityException:

The Lambda function couldn't make a network connection to the configured file system.

SubnetIPAddressLimitReachedException:

Lambda couldn't set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses.

KMSAccessDeniedException:

Lambda couldn't decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.

RequestTooLargeException:

The request payload exceeded the Invoke request body JSON input quota. For more information, see Lambda quotas.

KMSDisabledException:

Lambda couldn't decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.

UnsupportedMediaTypeException:

The content type of the Invoke request body is not JSON.

SerializedRequestEntityTooLargeException:

The request payload exceeded the maximum allowed size for serialized request entities.

InvalidRuntimeException:

The runtime or runtime version specified is not supported.

NoPublishedVersionException:

The function has no published versions available.

EC2UnexpectedException:

Lambda received an unexpected Amazon EC2 client exception while setting up for the Lambda function.

InvalidSubnetIDException:

The subnet ID provided in the Lambda function VPC configuration is not valid.

KMSNotFoundException:

Lambda couldn't decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.

InvalidParameterValueException:

One of the parameters in the request is not valid.

EC2AccessDeniedException:

Need additional permissions to configure VPC settings.

EFSIOException:

An error occurred when reading from or writing to a connected file system.

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.

ResourceConflictException:

The resource already exists, or another operation is in progress.

ENILimitReachedException:

Lambda couldn't create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached. For more information, see Lambda quotas.

SnapStartNotReadyException:

Lambda is initializing your function. You can invoke the function when the function state becomes Active.

ServiceException:

The Lambda service encountered an internal error.

SnapStartException:

The afterRestore() runtime hook encountered an error. For more information, check the Amazon CloudWatch logs.

RecursiveInvocationException:

Lambda has detected your function being invoked in a recursive loop with other Amazon Web Services resources and stopped your function's invocation.

EFSMountTimeoutException:

The Lambda function made a network connection to the configured file system, but the mount operation timed out.

ResourceNotFoundException:

The resource specified in the request does not exist.

InvalidRequestContentException:

The request body could not be parsed as JSON, or a request header is invalid. For example, the 'x-amzn-RequestId' header is not a valid UUID string.

DurableExecutionAlreadyStartedException:

The durable execution with the specified name has already been started. Each durable execution name must be unique within the function. Use a different name or check the status of the existing execution.

InvalidZipFileException:

Lambda could not unzip the deployment package.

EFSMountFailureException:

The Lambda function couldn't mount the configured file system due to a permission or configuration issue.

Examples

Example 1: To invoke a Lambda function

The following example invokes version 1 of a function named my-function with an empty event payload.

$result = $client->invoke([
    'DurableExecutionName' => 'myExecution',
    'FunctionName' => 'my-function',
    'InvocationType' => 'Event',
    'Payload' => <BLOB>,
    'Qualifier' => '1',
]);

Result syntax:

[
    'Payload' => <BLOB>,
    'StatusCode' => 200,
]
Example 2: To invoke a Lambda function asynchronously

The following example invokes version 1 of a function named my-function asynchronously.

$result = $client->invoke([
    'FunctionName' => 'my-function',
    'InvocationType' => 'Event',
    'Payload' => <BLOB>,
    'Qualifier' => '1',
]);

Result syntax:

[
    'Payload' => <BLOB>,
    'StatusCode' => 202,
]

InvokeAsynchronous

$result = $client->invokeAsynchronous([/* ... */]);
$promise = $client->invokeAsynchronousAsync([/* ... */]);

For asynchronous function invocation, use Invoke.

Invokes a function asynchronously.

The payload limit is 256KB. For larger payloads, for up to 1MB, use Invoke.

If you do use the InvokeAsync action, note that it doesn't support the use of X-Ray active tracing. Trace ID is not propagated to the function, even if X-Ray active tracing is turned on.

Parameter Syntax

$result = $client->invokeAsynchronous([
    'FunctionName' => '<string>', // REQUIRED
    'InvokeArgs' => <string || resource || Psr\Http\Message\StreamInterface>, // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

InvokeArgs
Required: Yes
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

The JSON that you want to provide to your Lambda function as input.

Result Syntax

[
    'Status' => <integer>,
]

Result Details

Members
Status
Type: int

The status code.

Errors

InvalidRuntimeException:

The runtime or runtime version specified is not supported.

ResourceConflictException:

The resource already exists, or another operation is in progress.

ServiceException:

The Lambda service encountered an internal error.

ResourceNotFoundException:

The resource specified in the request does not exist.

InvalidRequestContentException:

The request body could not be parsed as JSON, or a request header is invalid. For example, the 'x-amzn-RequestId' header is not a valid UUID string.

InvokeWithResponseStream

$result = $client->invokeWithResponseStream([/* ... */]);
$promise = $client->invokeWithResponseStreamAsync([/* ... */]);

Configure your Lambda functions to stream response payloads back to clients. For more information, see Configuring a Lambda function to stream responses.

This operation requires permission for the lambda:InvokeFunction action. For details on how to set up permissions for cross-account invocations, see Granting function access to other accounts.

Parameter Syntax

$result = $client->invokeWithResponseStream([
    'ClientContext' => '<string>',
    'FunctionName' => '<string>', // REQUIRED
    'InvocationType' => 'RequestResponse|DryRun',
    'LogType' => 'None|Tail',
    'Payload' => <string || resource || Psr\Http\Message\StreamInterface>,
    'Qualifier' => '<string>',
    'TenantId' => '<string>',
]);

Parameter Details

Members
ClientContext
Type: string

Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.

FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

InvocationType
Type: string

Use one of the following options:

  • RequestResponse (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API operation response includes the function response and additional data.

  • DryRun – Validate parameter values and verify that the IAM user or role has permission to invoke the function.

LogType
Type: string

Set to Tail to include the execution log in the response. Applies to synchronously invoked functions only.

Payload
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

The JSON that you want to provide to your Lambda function as input.

You can enter the JSON directly. For example, --payload '{ "key": "value" }'. You can also specify a file path. For example, --payload file://payload.json.

Qualifier
Type: string

The alias name.

TenantId
Type: string

The identifier of the tenant in a multi-tenant Lambda function.

Result Syntax

[
    'EventStream' => [ // EventParsingIterator
        'InvokeComplete' => [
            'ErrorCode' => '<string>',
            'ErrorDetails' => '<string>',
            'LogResult' => '<string>',
        ],
        'PayloadChunk' => [
            'Payload' => <string || resource || Psr\Http\Message\StreamInterface>,
        ],
    ],
    'ExecutedVersion' => '<string>',
    'ResponseStreamContentType' => '<string>',
    'StatusCode' => <integer>,
]

Result Details

Members
EventStream
Type: EventParsingIterator supplying the following structures: InvokeResponseStreamUpdate, InvokeWithResponseStreamCompleteEvent

The stream of response payloads.

ExecutedVersion
Type: string

The version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to.

ResponseStreamContentType
Type: string

The type of data the stream is returning.

StatusCode
Type: int

For a successful request, the HTTP status code is in the 200 range. For the RequestResponse invocation type, this status code is 200. For the DryRun invocation type, this status code is 204.

Using an EventParsingIterator

To use an EventParsingIterator, you will need to loop over the events it will generate and check the top-level field to determine which type of event it is.

foreach($result['EventStream'] as $event) {
    if (isset($event['InvokeComplete'])) {
        // Handle the 'InvokeComplete' event.
    } else if (isset($event['PayloadChunk'])) {
        // Handle the 'PayloadChunk' event.
    }
}

Errors

ResourceNotReadyException:

The function is inactive and its VPC connection is no longer available. Wait for the VPC connection to reestablish and try again.

InvalidSecurityGroupIDException:

The security group ID provided in the Lambda function VPC configuration is not valid.

SnapStartTimeoutException:

Lambda couldn't restore the snapshot within the timeout limit.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

EC2ThrottledException:

Amazon EC2 throttled Lambda during Lambda function initialization using the execution role provided for the function.

EFSMountConnectivityException:

The Lambda function couldn't make a network connection to the configured file system.

SubnetIPAddressLimitReachedException:

Lambda couldn't set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses.

KMSAccessDeniedException:

Lambda couldn't decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.

RequestTooLargeException:

The request payload exceeded the Invoke request body JSON input quota. For more information, see Lambda quotas.

KMSDisabledException:

Lambda couldn't decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.

UnsupportedMediaTypeException:

The content type of the Invoke request body is not JSON.

SerializedRequestEntityTooLargeException:

The request payload exceeded the maximum allowed size for serialized request entities.

InvalidRuntimeException:

The runtime or runtime version specified is not supported.

NoPublishedVersionException:

The function has no published versions available.

EC2UnexpectedException:

Lambda received an unexpected Amazon EC2 client exception while setting up for the Lambda function.

InvalidSubnetIDException:

The subnet ID provided in the Lambda function VPC configuration is not valid.

KMSNotFoundException:

Lambda couldn't decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.

InvalidParameterValueException:

One of the parameters in the request is not valid.

EC2AccessDeniedException:

Need additional permissions to configure VPC settings.

EFSIOException:

An error occurred when reading from or writing to a connected file system.

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.

ResourceConflictException:

The resource already exists, or another operation is in progress.

ENILimitReachedException:

Lambda couldn't create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached. For more information, see Lambda quotas.

SnapStartNotReadyException:

Lambda is initializing your function. You can invoke the function when the function state becomes Active.

ServiceException:

The Lambda service encountered an internal error.

SnapStartException:

The afterRestore() runtime hook encountered an error. For more information, check the Amazon CloudWatch logs.

RecursiveInvocationException:

Lambda has detected your function being invoked in a recursive loop with other Amazon Web Services resources and stopped your function's invocation.

EFSMountTimeoutException:

The Lambda function made a network connection to the configured file system, but the mount operation timed out.

ResourceNotFoundException:

The resource specified in the request does not exist.

InvalidRequestContentException:

The request body could not be parsed as JSON, or a request header is invalid. For example, the 'x-amzn-RequestId' header is not a valid UUID string.

InvalidZipFileException:

Lambda could not unzip the deployment package.

EFSMountFailureException:

The Lambda function couldn't mount the configured file system due to a permission or configuration issue.

ListAliases

$result = $client->listAliases([/* ... */]);
$promise = $client->listAliasesAsync([/* ... */]);

Returns a list of aliases for a Lambda function.

Parameter Syntax

$result = $client->listAliases([
    'FunctionName' => '<string>', // REQUIRED
    'FunctionVersion' => '<string>',
    'Marker' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
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
Type: string

Specify a function version to only list aliases that invoke that version.

Marker
Type: string

Specify the pagination token that's returned by a previous request to retrieve the next page of results.

MaxItems
Type: int

Limit the number of aliases returned.

Result Syntax

[
    'Aliases' => [
        [
            'AliasArn' => '<string>',
            'Description' => '<string>',
            'FunctionVersion' => '<string>',
            'Name' => '<string>',
            'RevisionId' => '<string>',
            'RoutingConfig' => [
                'AdditionalVersionWeights' => [<float>, ...],
            ],
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
Aliases
Type: Array of AliasConfiguration structures

A list of aliases.

NextMarker
Type: string

The pagination token that's included if more results are available.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 list a function's aliases

The following example returns a list of aliases for a function named my-function.

$result = $client->listAliases([
    'FunctionName' => 'my-function',
]);

Result syntax:

[
    'Aliases' => [
        [
            'AliasArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function:BETA',
            'Description' => 'Production environment BLUE.',
            'FunctionVersion' => '2',
            'Name' => 'BLUE',
            'RevisionId' => 'a410117f-xmpl-494e-8035-7e204bb7933b',
            'RoutingConfig' => [
                'AdditionalVersionWeights' => [
                    '0' => 0.7,
                ],
            ],
        ],
        [
            'AliasArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function:LIVE',
            'Description' => 'Production environment GREEN.',
            'FunctionVersion' => '1',
            'Name' => 'GREEN',
            'RevisionId' => '21d40116-xmpl-40ba-9360-3ea284da1bb5',
        ],
    ],
]

ListCapacityProviders

$result = $client->listCapacityProviders([/* ... */]);
$promise = $client->listCapacityProvidersAsync([/* ... */]);

Returns a list of capacity providers in your account.

Parameter Syntax

$result = $client->listCapacityProviders([
    'Marker' => '<string>',
    'MaxItems' => <integer>,
    'State' => 'Pending|Active|Failed|Deleting',
]);

Parameter Details

Members
Marker
Type: string

Specify the pagination token that's returned by a previous request to retrieve the next page of results.

MaxItems
Type: int

The maximum number of capacity providers to return.

State
Type: string

Filter capacity providers by their current state.

Result Syntax

[
    'CapacityProviders' => [
        [
            'CapacityProviderArn' => '<string>',
            'CapacityProviderScalingConfig' => [
                'MaxVCpuCount' => <integer>,
                'ScalingMode' => 'Auto|Manual',
                'ScalingPolicies' => [
                    [
                        'PredefinedMetricType' => 'LambdaCapacityProviderAverageCPUUtilization',
                        'TargetValue' => <float>,
                    ],
                    // ...
                ],
            ],
            'InstanceRequirements' => [
                'AllowedInstanceTypes' => ['<string>', ...],
                'Architectures' => ['<string>', ...],
                'ExcludedInstanceTypes' => ['<string>', ...],
            ],
            'KmsKeyArn' => '<string>',
            'LastModified' => '<string>',
            'PermissionsConfig' => [
                'CapacityProviderOperatorRoleArn' => '<string>',
            ],
            'State' => 'Pending|Active|Failed|Deleting',
            'VpcConfig' => [
                'SecurityGroupIds' => ['<string>', ...],
                'SubnetIds' => ['<string>', ...],
            ],
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
CapacityProviders
Required: Yes
Type: Array of CapacityProvider structures

A list of capacity providers in your account.

NextMarker
Type: string

The pagination token that's included if more results are available.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

ServiceException:

The Lambda service encountered an internal error.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

ListCodeSigningConfigs

$result = $client->listCodeSigningConfigs([/* ... */]);
$promise = $client->listCodeSigningConfigsAsync([/* ... */]);

Returns a list of code signing configurations. A request returns up to 10,000 configurations per call. You can use the MaxItems parameter to return fewer configurations per call.

Parameter Syntax

$result = $client->listCodeSigningConfigs([
    'Marker' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
Marker
Type: string

Specify the pagination token that's returned by a previous request to retrieve the next page of results.

MaxItems
Type: int

Maximum number of items to return.

Result Syntax

[
    'CodeSigningConfigs' => [
        [
            'AllowedPublishers' => [
                'SigningProfileVersionArns' => ['<string>', ...],
            ],
            'CodeSigningConfigArn' => '<string>',
            'CodeSigningConfigId' => '<string>',
            'CodeSigningPolicies' => [
                'UntrustedArtifactOnDeployment' => 'Warn|Enforce',
            ],
            'Description' => '<string>',
            'LastModified' => '<string>',
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
CodeSigningConfigs
Type: Array of CodeSigningConfig structures

The code signing configurations

NextMarker
Type: string

The pagination token that's included if more results are available.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

ServiceException:

The Lambda service encountered an internal error.

ListDurableExecutionsByFunction

$result = $client->listDurableExecutionsByFunction([/* ... */]);
$promise = $client->listDurableExecutionsByFunctionAsync([/* ... */]);

Returns a list of durable executions for a specified Lambda function. You can filter the results by execution name, status, and start time range. This API supports pagination for large result sets.

Parameter Syntax

$result = $client->listDurableExecutionsByFunction([
    'DurableExecutionName' => '<string>',
    'FunctionName' => '<string>', // REQUIRED
    'Marker' => '<string>',
    'MaxItems' => <integer>,
    'Qualifier' => '<string>',
    'ReverseOrder' => true || false,
    'StartedAfter' => <integer || string || DateTime>,
    'StartedBefore' => <integer || string || DateTime>,
    'Statuses' => ['<string>', ...],
]);

Parameter Details

Members
DurableExecutionName
Type: string

Filter executions by name. Only executions with names that contain this string are returned.

FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function. You can specify a function name, a partial ARN, or a full ARN.

Marker
Type: string

Pagination token from a previous request to continue retrieving results.

MaxItems
Type: int

Maximum number of executions to return (1-1000). Default is 100.

Qualifier
Type: string

The function version or alias. If not specified, lists executions for the $LATEST version.

ReverseOrder
Type: boolean

Set to true to return results in reverse chronological order (newest first). Default is false.

StartedAfter
Type: timestamp (string|DateTime or anything parsable by strtotime)

Filter executions that started after this timestamp (ISO 8601 format).

StartedBefore
Type: timestamp (string|DateTime or anything parsable by strtotime)

Filter executions that started before this timestamp (ISO 8601 format).

Statuses
Type: Array of strings

Filter executions by status. Valid values: RUNNING, SUCCEEDED, FAILED, TIMED_OUT, STOPPED.

Result Syntax

[
    'DurableExecutions' => [
        [
            'DurableExecutionArn' => '<string>',
            'DurableExecutionName' => '<string>',
            'EndTimestamp' => <DateTime>,
            'FunctionArn' => '<string>',
            'StartTimestamp' => <DateTime>,
            'Status' => 'RUNNING|SUCCEEDED|FAILED|TIMED_OUT|STOPPED',
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
DurableExecutions
Type: Array of Execution structures

List of durable execution summaries matching the filter criteria.

NextMarker
Type: string

Pagination token for retrieving additional results. Present only if there are more results available.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

ServiceException:

The Lambda service encountered an internal error.

ResourceNotFoundException:

The resource specified in the request does not exist.

ListEventSourceMappings

$result = $client->listEventSourceMappings([/* ... */]);
$promise = $client->listEventSourceMappingsAsync([/* ... */]);

Lists event source mappings. Specify an EventSourceArn to show only event source mappings for a single event source.

Parameter Syntax

$result = $client->listEventSourceMappings([
    'EventSourceArn' => '<string>',
    'FunctionName' => '<string>',
    'Marker' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
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.

FunctionName
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function nameMyFunction.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction.

  • Version or Alias ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.

  • Partial ARN123456789012: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.

Marker
Type: string

A pagination token returned by a previous call.

MaxItems
Type: int

The maximum number of event source mappings to return. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher.

Result Syntax

[
    'EventSourceMappings' => [
        [
            'AmazonManagedKafkaEventSourceConfig' => [
                'ConsumerGroupId' => '<string>',
                'SchemaRegistryConfig' => [
                    'AccessConfigs' => [
                        [
                            'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE',
                            '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>',
            '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>',
                'SchemaRegistryConfig' => [
                    'AccessConfigs' => [
                        [
                            'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE',
                            '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',
                    'URI' => '<string>',
                ],
                // ...
            ],
            'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP',
            'StartingPositionTimestamp' => <DateTime>,
            'State' => '<string>',
            'StateTransitionReason' => '<string>',
            'Topics' => ['<string>', ...],
            'TumblingWindowInSeconds' => <integer>,
            'UUID' => '<string>',
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
EventSourceMappings
Type: Array of EventSourceMappingConfiguration structures

A list of event source mappings.

NextMarker
Type: string

A pagination token that's returned when the response doesn't contain all event source mappings.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 list the event source mappings for a function

The following example returns a list of the event source mappings for a function named my-function.

$result = $client->listEventSourceMappings([
    'FunctionName' => 'my-function',
]);

Result syntax:

[
    'EventSourceMappings' => [
        [
            'BatchSize' => 5,
            'EventSourceArn' => 'arn:aws:sqs:us-west-2:123456789012:mySQSqueue',
            'FunctionArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function',
            'LastModified' => ,
            'State' => 'Enabled',
            'StateTransitionReason' => 'USER_INITIATED',
            'UUID' => 'a1b2c3d4-5678-90ab-cdef-11111EXAMPLE',
        ],
    ],
]

ListFunctionEventInvokeConfigs

$result = $client->listFunctionEventInvokeConfigs([/* ... */]);
$promise = $client->listFunctionEventInvokeConfigsAsync([/* ... */]);

Retrieves a list of configurations for asynchronous invocation for a function.

To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

Parameter Syntax

$result = $client->listFunctionEventInvokeConfigs([
    'FunctionName' => '<string>', // REQUIRED
    'Marker' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
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.

Marker
Type: string

Specify the pagination token that's returned by a previous request to retrieve the next page of results.

MaxItems
Type: int

The maximum number of configurations to return.

Result Syntax

[
    'FunctionEventInvokeConfigs' => [
        [
            'DestinationConfig' => [
                'OnFailure' => [
                    'Destination' => '<string>',
                ],
                'OnSuccess' => [
                    'Destination' => '<string>',
                ],
            ],
            'FunctionArn' => '<string>',
            'LastModified' => <DateTime>,
            'MaximumEventAgeInSeconds' => <integer>,
            'MaximumRetryAttempts' => <integer>,
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
FunctionEventInvokeConfigs
Type: Array of FunctionEventInvokeConfig structures

A list of configurations.

NextMarker
Type: string

The pagination token that's included if more results are available.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 view a list of asynchronous invocation configurations

The following example returns a list of asynchronous invocation configurations for a function named my-function.

$result = $client->listFunctionEventInvokeConfigs([
    'FunctionName' => 'my-function',
]);

Result syntax:

[
    'FunctionEventInvokeConfigs' => [
        [
            'FunctionArn' => 'arn:aws:lambda:us-east-2:123456789012:function:my-function:GREEN',
            'LastModified' => ,
            'MaximumEventAgeInSeconds' => 1800,
            'MaximumRetryAttempts' => 2,
        ],
        [
            'FunctionArn' => 'arn:aws:lambda:us-east-2:123456789012:function:my-function:BLUE',
            'LastModified' => ,
            'MaximumEventAgeInSeconds' => 3600,
            'MaximumRetryAttempts' => 0,
        ],
    ],
]

ListFunctionUrlConfigs

$result = $client->listFunctionUrlConfigs([/* ... */]);
$promise = $client->listFunctionUrlConfigsAsync([/* ... */]);

Returns a list of Lambda function URLs for the specified function.

Parameter Syntax

$result = $client->listFunctionUrlConfigs([
    'FunctionName' => '<string>', // REQUIRED
    'Marker' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Marker
Type: string

Specify the pagination token that's returned by a previous request to retrieve the next page of results.

MaxItems
Type: int

The maximum number of function URLs to return in the response. Note that ListFunctionUrlConfigs returns a maximum of 50 items in each response, even if you set the number higher.

Result Syntax

[
    'FunctionUrlConfigs' => [
        [
            'AuthType' => 'NONE|AWS_IAM',
            'Cors' => [
                'AllowCredentials' => true || false,
                'AllowHeaders' => ['<string>', ...],
                'AllowMethods' => ['<string>', ...],
                'AllowOrigins' => ['<string>', ...],
                'ExposeHeaders' => ['<string>', ...],
                'MaxAge' => <integer>,
            ],
            'CreationTime' => '<string>',
            'FunctionArn' => '<string>',
            'FunctionUrl' => '<string>',
            'InvokeMode' => 'BUFFERED|RESPONSE_STREAM',
            'LastModifiedTime' => '<string>',
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
FunctionUrlConfigs
Required: Yes
Type: Array of FunctionUrlConfig structures

A list of function URL configurations.

NextMarker
Type: string

The pagination token that's included if more results are available.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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.

ListFunctionVersionsByCapacityProvider

$result = $client->listFunctionVersionsByCapacityProvider([/* ... */]);
$promise = $client->listFunctionVersionsByCapacityProviderAsync([/* ... */]);

Returns a list of function versions that are configured to use a specific capacity provider.

Parameter Syntax

$result = $client->listFunctionVersionsByCapacityProvider([
    'CapacityProviderName' => '<string>', // REQUIRED
    'Marker' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
CapacityProviderName
Required: Yes
Type: string

The name of the capacity provider to list function versions for.

Marker
Type: string

Specify the pagination token that's returned by a previous request to retrieve the next page of results.

MaxItems
Type: int

The maximum number of function versions to return in the response.

Result Syntax

[
    'CapacityProviderArn' => '<string>',
    'FunctionVersions' => [
        [
            'FunctionArn' => '<string>',
            'State' => 'Pending|Active|Inactive|Failed|Deactivating|Deactivated|ActiveNonInvocable|Deleting',
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
CapacityProviderArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the capacity provider.

FunctionVersions
Required: Yes
Type: Array of FunctionVersionsByCapacityProviderListItem structures

A list of function versions that use the specified capacity provider.

NextMarker
Type: string

The pagination token that's included if more results are available.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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.

ListFunctions

$result = $client->listFunctions([/* ... */]);
$promise = $client->listFunctionsAsync([/* ... */]);

Returns a list of Lambda functions, with the version-specific configuration of each. Lambda returns up to 50 functions per call.

Set FunctionVersion to ALL to include all published versions of each function in addition to the unpublished version.

The ListFunctions operation returns a subset of the FunctionConfiguration fields. To get the additional fields (State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode, RuntimeVersionConfig) for a function or version, use GetFunction.

Parameter Syntax

$result = $client->listFunctions([
    'FunctionVersion' => 'ALL',
    'Marker' => '<string>',
    'MasterRegion' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
FunctionVersion
Type: string

Set to ALL to include entries for all published versions of each function.

Marker
Type: string

Specify the pagination token that's returned by a previous request to retrieve the next page of results.

MasterRegion
Type: string

For Lambda@Edge functions, the Amazon Web Services Region of the master function. For example, us-east-1 filters the list of functions to include only Lambda@Edge functions replicated from a master function in US East (N. Virginia). If specified, you must set FunctionVersion to ALL.

MaxItems
Type: int

The maximum number of functions to return in the response. Note that ListFunctions returns a maximum of 50 items in each response, even if you set the number higher.

Result Syntax

[
    'Functions' => [
        [
            'Architectures' => ['<string>', ...],
            'CapacityProviderConfig' => [
                'LambdaManagedInstancesCapacityProviderConfig' => [
                    'CapacityProviderArn' => '<string>',
                    'ExecutionEnvironmentMemoryGiBPerVCpu' => <float>,
                    'PerExecutionEnvironmentMaxConcurrency' => <integer>,
                ],
            ],
            'CodeSha256' => '<string>',
            'CodeSize' => <integer>,
            'ConfigSha256' => '<string>',
            'DeadLetterConfig' => [
                'TargetArn' => '<string>',
            ],
            'Description' => '<string>',
            'DurableConfig' => [
                'ExecutionTimeout' => <integer>,
                'RetentionPeriodInDays' => <integer>,
            ],
            'Environment' => [
                'Error' => [
                    'ErrorCode' => '<string>',
                    'Message' => '<string>',
                ],
                'Variables' => ['<string>', ...],
            ],
            'EphemeralStorage' => [
                'Size' => <integer>,
            ],
            'FileSystemConfigs' => [
                [
                    'Arn' => '<string>',
                    'LocalMountPath' => '<string>',
                ],
                // ...
            ],
            '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|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
            '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|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|python3.9|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2|nodejs18.x|python3.10|java17|ruby3.2|ruby3.3|ruby3.4|python3.11|nodejs20.x|provided.al2023|python3.12|java21|python3.13|nodejs22.x|nodejs24.x|python3.14|java25',
            '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|DrainingDurableExecutions|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
            'TenancyConfig' => [
                'TenantIsolationMode' => 'PER_TENANT',
            ],
            'Timeout' => <integer>,
            'TracingConfig' => [
                'Mode' => 'Active|PassThrough',
            ],
            'Version' => '<string>',
            'VpcConfig' => [
                'Ipv6AllowedForDualStack' => true || false,
                'SecurityGroupIds' => ['<string>', ...],
                'SubnetIds' => ['<string>', ...],
                'VpcId' => '<string>',
            ],
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
Functions
Type: Array of FunctionConfiguration structures

A list of Lambda functions.

NextMarker
Type: string

The pagination token that's included if more results are available.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

ServiceException:

The Lambda service encountered an internal error.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

Examples

Example 1: To get a list of Lambda functions

This operation returns a list of Lambda functions.

$result = $client->listFunctions([
]);

Result syntax:

[
    'Functions' => [
        [
            'CodeSha256' => 'dBG9m8SGdmlEjw/JYXlhhvCrAv5TxvXsbL/RMr0fT/I=',
            'CodeSize' => 294,
            'Description' => '',
            'FunctionArn' => 'arn:aws:lambda:us-west-2:123456789012:function:helloworld',
            'FunctionName' => 'helloworld',
            'Handler' => 'helloworld.handler',
            'LastModified' => '2019-09-23T18:32:33.857+0000',
            'MemorySize' => 128,
            'RevisionId' => '1718e831-badf-4253-9518-d0644210af7b',
            'Role' => 'arn:aws:iam::123456789012:role/service-role/MyTestFunction-role-zgur6bf4',
            'Runtime' => 'nodejs10.x',
            'Timeout' => 3,
            'TracingConfig' => [
                'Mode' => 'PassThrough',
            ],
            'Version' => '$LATEST',
        ],
        [
            'CodeSha256' => 'sU0cJ2/hOZevwV/lTxCuQqK3gDZP3i8gUoqUUVRmY6E=',
            'CodeSize' => 266,
            'Description' => '',
            'DurableConfig' => [
                'ExecutionTimeout' => 31622400,
                'RetentionPeriodInDays' => 30,
            ],
            'FunctionArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function',
            'FunctionName' => 'my-function',
            'Handler' => 'index.handler',
            'LastModified' => '2019-10-01T16:47:28.490+0000',
            'MemorySize' => 256,
            'RevisionId' => '93017fc9-59cb-41dc-901b-4845ce4bf668',
            'Role' => 'arn:aws:iam::123456789012:role/service-role/helloWorldPython-role-uy3l9qyq',
            'Runtime' => 'nodejs10.x',
            'Timeout' => 3,
            'TracingConfig' => [
                'Mode' => 'PassThrough',
            ],
            'Version' => '$LATEST',
            'VpcConfig' => [
                'SecurityGroupIds' => [
                ],
                'SubnetIds' => [
                ],
                'VpcId' => '',
            ],
        ],
    ],
    'NextMarker' => '',
]

ListFunctionsByCodeSigningConfig

$result = $client->listFunctionsByCodeSigningConfig([/* ... */]);
$promise = $client->listFunctionsByCodeSigningConfigAsync([/* ... */]);

List the functions that use the specified code signing configuration. You can use this method prior to deleting a code signing configuration, to verify that no functions are using it.

Parameter Syntax

$result = $client->listFunctionsByCodeSigningConfig([
    'CodeSigningConfigArn' => '<string>', // REQUIRED
    'Marker' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
CodeSigningConfigArn
Required: Yes
Type: string

The The Amazon Resource Name (ARN) of the code signing configuration.

Marker
Type: string

Specify the pagination token that's returned by a previous request to retrieve the next page of results.

MaxItems
Type: int

Maximum number of items to return.

Result Syntax

[
    'FunctionArns' => ['<string>', ...],
    'NextMarker' => '<string>',
]

Result Details

Members
FunctionArns
Type: Array of strings

The function ARNs.

NextMarker
Type: string

The pagination token that's included if more results are available.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

ServiceException:

The Lambda service encountered an internal error.

ResourceNotFoundException:

The resource specified in the request does not exist.

ListLayerVersions

$result = $client->listLayerVersions([/* ... */]);
$promise = $client->listLayerVersionsAsync([/* ... */]);

Lists the versions of an Lambda layer. Versions that have been deleted aren't listed. Specify a runtime identifier to list only versions that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layer versions that are compatible with that architecture.

Parameter Syntax

$result = $client->listLayerVersions([
    'CompatibleArchitecture' => 'x86_64|arm64',
    'CompatibleRuntime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|nodejs14.x|nodejs16.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|python3.9|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2|nodejs18.x|python3.10|java17|ruby3.2|ruby3.3|ruby3.4|python3.11|nodejs20.x|provided.al2023|python3.12|java21|python3.13|nodejs22.x|nodejs24.x|python3.14|java25',
    'LayerName' => '<string>', // REQUIRED
    'Marker' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
CompatibleArchitecture
Type: string
CompatibleRuntime
Type: string

A runtime identifier.

The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.

For a list of all currently supported runtimes, see Supported runtimes.

LayerName
Required: Yes
Type: string

The name or Amazon Resource Name (ARN) of the layer.

Marker
Type: string

A pagination token returned by a previous call.

MaxItems
Type: int

The maximum number of versions to return.

Result Syntax

[
    'LayerVersions' => [
        [
            'CompatibleArchitectures' => ['<string>', ...],
            'CompatibleRuntimes' => ['<string>', ...],
            'CreatedDate' => '<string>',
            'Description' => '<string>',
            'LayerVersionArn' => '<string>',
            'LicenseInfo' => '<string>',
            'Version' => <integer>,
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
LayerVersions
Type: Array of LayerVersionsListItem structures

A list of versions.

NextMarker
Type: string

A pagination token returned when the response doesn't contain all versions.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 list versions of a layer

The following example displays information about the versions for the layer named blank-java-lib

$result = $client->listLayerVersions([
    'LayerName' => 'blank-java-lib',
]);

Result syntax:

[
    'LayerVersions' => [
        [
            'CompatibleRuntimes' => [
                'java8',
            ],
            'CreatedDate' => '2020-03-18T23:38:42.284+0000',
            'Description' => 'Dependencies for the blank-java sample app.',
            'LayerVersionArn' => 'arn:aws:lambda:us-east-2:123456789012:layer:blank-java-lib:7',
            'Version' => 7,
        ],
        [
            'CompatibleRuntimes' => [
                'java8',
            ],
            'CreatedDate' => '2020-03-17T07:24:21.960+0000',
            'Description' => 'Dependencies for the blank-java sample app.',
            'LayerVersionArn' => 'arn:aws:lambda:us-east-2:123456789012:layer:blank-java-lib:6',
            'Version' => 6,
        ],
    ],
]

ListLayers

$result = $client->listLayers([/* ... */]);
$promise = $client->listLayersAsync([/* ... */]);

Lists Lambda layers and shows information about the latest version of each. Specify a runtime identifier to list only layers that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layers that are compatible with that instruction set architecture.

Parameter Syntax

$result = $client->listLayers([
    'CompatibleArchitecture' => 'x86_64|arm64',
    'CompatibleRuntime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|nodejs14.x|nodejs16.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|python3.9|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2|nodejs18.x|python3.10|java17|ruby3.2|ruby3.3|ruby3.4|python3.11|nodejs20.x|provided.al2023|python3.12|java21|python3.13|nodejs22.x|nodejs24.x|python3.14|java25',
    'Marker' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
CompatibleArchitecture
Type: string
CompatibleRuntime
Type: string

A runtime identifier.

The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.

For a list of all currently supported runtimes, see Supported runtimes.

Marker
Type: string

A pagination token returned by a previous call.

MaxItems
Type: int

The maximum number of layers to return.

Result Syntax

[
    'Layers' => [
        [
            'LatestMatchingVersion' => [
                'CompatibleArchitectures' => ['<string>', ...],
                'CompatibleRuntimes' => ['<string>', ...],
                'CreatedDate' => '<string>',
                'Description' => '<string>',
                'LayerVersionArn' => '<string>',
                'LicenseInfo' => '<string>',
                'Version' => <integer>,
            ],
            'LayerArn' => '<string>',
            'LayerName' => '<string>',
        ],
        // ...
    ],
    'NextMarker' => '<string>',
]

Result Details

Members
Layers
Type: Array of LayersListItem structures

A list of function layers.

NextMarker
Type: string

A pagination token returned when the response doesn't contain all layers.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

ServiceException:

The Lambda service encountered an internal error.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

Examples

Example 1: To list the layers that are compatible with your function's runtime

The following example returns information about layers that are compatible with the Python 3.7 runtime.

$result = $client->listLayers([
    'CompatibleRuntime' => 'python3.7',
]);

Result syntax:

[
    'Layers' => [
        [
            'LatestMatchingVersion' => [
                'CompatibleRuntimes' => [
                    'python3.6',
                    'python3.7',
                ],
                'CreatedDate' => '2018-11-15T00:37:46.592+0000',
                'Description' => 'My layer',
                'LayerVersionArn' => 'arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2',
                'Version' => 2,
            ],
            'LayerArn' => 'arn:aws:lambda:us-east-2:123456789012:layer:my-layer',
            'LayerName' => 'my-layer',
        ],
    ],
]

ListProvisionedConcurrencyConfigs

$result = $client->listProvisionedConcurrencyConfigs([/* ... */]);
$promise = $client->listProvisionedConcurrencyConfigsAsync([/* ... */]);

Retrieves a list of provisioned concurrency configurations for a function.

Parameter Syntax

$result = $client->listProvisionedConcurrencyConfigs([
    'FunctionName' => '<string>', // REQUIRED
    'Marker' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Marker
Type: string

Specify the pagination token that's returned by a previous request to retrieve the next page of results.

MaxItems
Type: int

Specify a number to limit the number of configurations returned.

Result Syntax

[
    'NextMarker' => '<string>',
    'ProvisionedConcurrencyConfigs' => [
        [
            'AllocatedProvisionedConcurrentExecutions' => <integer>,
            'AvailableProvisionedConcurrentExecutions' => <integer>,
            'FunctionArn' => '<string>',
            'LastModified' => '<string>',
            'RequestedProvisionedConcurrentExecutions' => <integer>,
            'Status' => 'IN_PROGRESS|READY|FAILED',
            'StatusReason' => '<string>',
        ],
        // ...
    ],
]

Result Details

Members
NextMarker
Type: string

The pagination token that's included if more results are available.

ProvisionedConcurrencyConfigs
Type: Array of ProvisionedConcurrencyConfigListItem structures

A list of provisioned concurrency configurations.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 get a list of provisioned concurrency configurations

The following example returns a list of provisioned concurrency configurations for a function named my-function.

$result = $client->listProvisionedConcurrencyConfigs([
    'FunctionName' => 'my-function',
]);

Result syntax:

[
    'ProvisionedConcurrencyConfigs' => [
        [
            'AllocatedProvisionedConcurrentExecutions' => 100,
            'AvailableProvisionedConcurrentExecutions' => 100,
            'FunctionArn' => 'arn:aws:lambda:us-east-2:123456789012:function:my-function:GREEN',
            'LastModified' => '2019-12-31T20:29:00+0000',
            'RequestedProvisionedConcurrentExecutions' => 100,
            'Status' => 'READY',
        ],
        [
            'AllocatedProvisionedConcurrentExecutions' => 100,
            'AvailableProvisionedConcurrentExecutions' => 100,
            'FunctionArn' => 'arn:aws:lambda:us-east-2:123456789012:function:my-function:BLUE',
            'LastModified' => '2019-12-31T20:28:49+0000',
            'RequestedProvisionedConcurrentExecutions' => 100,
            'Status' => 'READY',
        ],
    ],
]

ListTags

$result = $client->listTags([/* ... */]);
$promise = $client->listTagsAsync([/* ... */]);

Returns a function, event source mapping, or code signing configuration's tags. You can also view function tags with GetFunction.

Parameter Syntax

$result = $client->listTags([
    'Resource' => '<string>', // REQUIRED
]);

Parameter Details

Members
Resource
Required: Yes
Type: string

The resource's Amazon Resource Name (ARN). Note: Lambda does not support adding tags to function aliases or versions.

Result Syntax

[
    'Tags' => ['<string>', ...],
]

Result Details

Members
Tags
Type: Associative array of custom strings keys (TagKey) to strings

The function's tags.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 retrieve the list of tags for a Lambda function

The following example displays the tags attached to the my-function Lambda function.

$result = $client->listTags([
    'Resource' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function',
]);

Result syntax:

[
    'Tags' => [
        'Category' => 'Web Tools',
        'Department' => 'Sales',
    ],
]

ListVersionsByFunction

$result = $client->listVersionsByFunction([/* ... */]);
$promise = $client->listVersionsByFunctionAsync([/* ... */]);

Returns a list of versions, with the version-specific configuration of each. Lambda returns up to 50 versions per call.

Parameter Syntax

$result = $client->listVersionsByFunction([
    'FunctionName' => '<string>', // REQUIRED
    'Marker' => '<string>',
    'MaxItems' => <integer>,
]);

Parameter Details

Members
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.

Marker
Type: string

Specify the pagination token that's returned by a previous request to retrieve the next page of results.

MaxItems
Type: int

The maximum number of versions to return. Note that ListVersionsByFunction returns a maximum of 50 items in each response, even if you set the number higher.

Result Syntax

[
    'NextMarker' => '<string>',
    'Versions' => [
        [
            'Architectures' => ['<string>', ...],
            'CapacityProviderConfig' => [
                'LambdaManagedInstancesCapacityProviderConfig' => [
                    'CapacityProviderArn' => '<string>',
                    'ExecutionEnvironmentMemoryGiBPerVCpu' => <float>,
                    'PerExecutionEnvironmentMaxConcurrency' => <integer>,
                ],
            ],
            'CodeSha256' => '<string>',
            'CodeSize' => <integer>,
            'ConfigSha256' => '<string>',
            'DeadLetterConfig' => [
                'TargetArn' => '<string>',
            ],
            'Description' => '<string>',
            'DurableConfig' => [
                'ExecutionTimeout' => <integer>,
                'RetentionPeriodInDays' => <integer>,
            ],
            'Environment' => [
                'Error' => [
                    'ErrorCode' => '<string>',
                    'Message' => '<string>',
                ],
                'Variables' => ['<string>', ...],
            ],
            'EphemeralStorage' => [
                'Size' => <integer>,
            ],
            'FileSystemConfigs' => [
                [
                    'Arn' => '<string>',
                    'LocalMountPath' => '<string>',
                ],
                // ...
            ],
            '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|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
            '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|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|python3.9|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2|nodejs18.x|python3.10|java17|ruby3.2|ruby3.3|ruby3.4|python3.11|nodejs20.x|provided.al2023|python3.12|java21|python3.13|nodejs22.x|nodejs24.x|python3.14|java25',
            '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|DrainingDurableExecutions|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
            '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
NextMarker
Type: string

The pagination token that's included if more results are available.

Versions
Type: Array of FunctionConfiguration structures

A list of Lambda function versions.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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 list versions of a function

The following example returns a list of versions of a function named my-function

$result = $client->listVersionsByFunction([
    'FunctionName' => 'my-function',
]);

Result syntax:

[
    'Versions' => [
        [
            'CodeSha256' => 'YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=',
            'CodeSize' => 5797206,
            'Description' => 'Process image objects from Amazon S3.',
            'DurableConfig' => [
                'ExecutionTimeout' => 31622400,
                'RetentionPeriodInDays' => 30,
            ],
            'Environment' => [
                'Variables' => [
                    'BUCKET' => 'my-bucket-1xpuxmplzrlbh',
                    'PREFIX' => 'inbound',
                ],
            ],
            'FunctionArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function',
            'FunctionName' => 'my-function',
            'Handler' => 'index.handler',
            'KMSKeyArn' => 'arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966',
            'LastModified' => '2020-04-10T19:06:32.563+0000',
            'MemorySize' => 256,
            'RevisionId' => '850ca006-2d98-4ff4-86db-8766e9d32fe9',
            'Role' => 'arn:aws:iam::123456789012:role/lambda-role',
            'Runtime' => 'nodejs12.x',
            'Timeout' => 15,
            'TracingConfig' => [
                'Mode' => 'Active',
            ],
            'Version' => '$LATEST',
        ],
        [
            'CodeSha256' => 'YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=',
            'CodeSize' => 5797206,
            'Description' => 'Process image objects from Amazon S3.',
            'DurableConfig' => [
                'ExecutionTimeout' => 31622400,
                'RetentionPeriodInDays' => 30,
            ],
            'Environment' => [
                'Variables' => [
                    'BUCKET' => 'my-bucket-1xpuxmplzrlbh',
                    'PREFIX' => 'inbound',
                ],
            ],
            'FunctionArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function',
            'FunctionName' => 'my-function',
            'Handler' => 'index.handler',
            'KMSKeyArn' => 'arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966',
            'LastModified' => '2020-04-10T19:06:32.563+0000',
            'MemorySize' => 256,
            'RevisionId' => 'b75dcd81-xmpl-48a8-a75a-93ba8b5b9727',
            'Role' => 'arn:aws:iam::123456789012:role/lambda-role',
            'Runtime' => 'nodejs12.x',
            'Timeout' => 5,
            'TracingConfig' => [
                'Mode' => 'Active',
            ],
            'Version' => '1',
        ],
    ],
]

PublishLayerVersion

$result = $client->publishLayerVersion([/* ... */]);
$promise = $client->publishLayerVersionAsync([/* ... */]);

Creates an Lambda layer from a ZIP archive. Each time you call PublishLayerVersion with the same layer name, a new version is created.

Add layers to your function with CreateFunction or UpdateFunctionConfiguration.

Parameter Syntax

$result = $client->publishLayerVersion([
    'CompatibleArchitectures' => ['<string>', ...],
    'CompatibleRuntimes' => ['<string>', ...],
    'Content' => [ // REQUIRED
        'S3Bucket' => '<string>',
        'S3Key' => '<string>',
        'S3ObjectVersion' => '<string>',
        'ZipFile' => <string || resource || Psr\Http\Message\StreamInterface>,
    ],
    'Description' => '<string>',
    'LayerName' => '<string>', // REQUIRED
    'LicenseInfo' => '<string>',
]);

Parameter Details

Members
CompatibleArchitectures
Type: Array of strings

A list of compatible instruction set architectures.

CompatibleRuntimes
Type: Array of strings

A list of compatible function runtimes. Used for filtering with ListLayers and ListLayerVersions.

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

Content
Required: Yes
Type: LayerVersionContentInput structure

The function layer archive.

Description
Type: string

The description of the version.

LayerName
Required: Yes
Type: string

The name or Amazon Resource Name (ARN) of the layer.

LicenseInfo
Type: string

The layer's software license. It can be any of the following:

  • An SPDX license identifier. For example, MIT.

  • The URL of a license hosted on the internet. For example, https://opensource.org/licenses/MIT.

  • The full text of the license.

Result Syntax

[
    'CompatibleArchitectures' => ['<string>', ...],
    'CompatibleRuntimes' => ['<string>', ...],
    'Content' => [
        'CodeSha256' => '<string>',
        'CodeSize' => <integer>,
        'Location' => '<string>',
        'SigningJobArn' => '<string>',
        'SigningProfileVersionArn' => '<string>',
    ],
    'CreatedDate' => '<string>',
    'Description' => '<string>',
    'LayerArn' => '<string>',
    'LayerVersionArn' => '<string>',
    'LicenseInfo' => '<string>',
    'Version' => <integer>,
]

Result Details

Members
CompatibleArchitectures
Type: Array of strings

A list of compatible instruction set architectures.

CompatibleRuntimes
Type: Array of strings

The layer's compatible runtimes.

The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.

For a list of all currently supported runtimes, see Supported runtimes.

Content
Type: LayerVersionContentOutput structure

Details about the layer version.

CreatedDate
Type: string

The date that the layer version was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

Description
Type: string

The description of the version.

LayerArn
Type: string

The ARN of the layer.

LayerVersionArn
Type: string

The ARN of the layer version.

LicenseInfo
Type: string

The layer's software license.

Version
Type: long (int|float)

The version number.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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.

CodeStorageExceededException:

Your Amazon Web Services account has exceeded its maximum total code size. For more information, see Lambda quotas.

Examples

Example 1: To create a Lambda layer version

The following example creates a new Python library layer version. The command retrieves the layer content a file named layer.zip in the specified S3 bucket.

$result = $client->publishLayerVersion([
    'CompatibleRuntimes' => [
        'python3.6',
        'python3.7',
    ],
    'Content' => [
        'S3Bucket' => 'lambda-layers-us-west-2-123456789012',
        'S3Key' => 'layer.zip',
    ],
    'Description' => 'My Python layer',
    'LayerName' => 'my-layer',
    'LicenseInfo' => 'MIT',
]);

Result syntax:

[
    'CompatibleRuntimes' => [
        'python3.6',
        'python3.7',
    ],
    'Content' => [
        'CodeSha256' => 'tv9jJO+rPbXUUXuRKi7CwHzKtLDkDRJLB3cC3Z/ouXo=',
        'CodeSize' => 169,
        'Location' => 'https://awslambda-us-west-2-layers.s3.us-west-2.amazonaws.com/snapshots/123456789012/my-layer-4aaa2fbb-ff77-4b0a-ad92-5b78a716a96a?versionId=27iWyA73cCAYqyH...',
    ],
    'CreatedDate' => '2018-11-14T23:03:52.894+0000',
    'Description' => 'My Python layer',
    'LayerArn' => 'arn:aws:lambda:us-west-2:123456789012:layer:my-layer',
    'LayerVersionArn' => 'arn:aws:lambda:us-west-2:123456789012:layer:my-layer:1',
    'LicenseInfo' => 'MIT',
    'Version' => 1,
]

PublishVersion

$result = $client->publishVersion([/* ... */]);
$promise = $client->publishVersionAsync([/* ... */]);

Creates a version from the current code and configuration of a function. Use versions to create a snapshot of your function code and configuration that doesn't change.

Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version. Use UpdateFunctionCode or UpdateFunctionConfiguration to update the function before publishing a version.

Clients can invoke versions directly or with an alias. To create an alias, use CreateAlias.

Parameter Syntax

$result = $client->publishVersion([
    'CodeSha256' => '<string>',
    'Description' => '<string>',
    'FunctionName' => '<string>', // REQUIRED
    'PublishTo' => 'LATEST_PUBLISHED',
    'RevisionId' => '<string>',
]);

Parameter Details

Members
CodeSha256
Type: string

Only publish a version if the hash value matches the value that's specified. Use this option to avoid publishing a version if the function code has changed since you last updated it. You can get the hash for the version that you uploaded from the output of UpdateFunctionCode.

Description
Type: string

A description for the version to override the description in the function configuration.

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.

PublishTo
Type: string

Specifies where to publish the function version or configuration.

RevisionId
Type: string

Only update the function if the revision ID matches the ID that's specified. Use this option to avoid publishing a version if the function configuration has changed since you last updated it.

Result Syntax

[
    'Architectures' => ['<string>', ...],
    'CapacityProviderConfig' => [
        'LambdaManagedInstancesCapacityProviderConfig' => [
            'CapacityProviderArn' => '<string>',
            'ExecutionEnvironmentMemoryGiBPerVCpu' => <float>,
            'PerExecutionEnvironmentMaxConcurrency' => <integer>,
        ],
    ],
    'CodeSha256' => '<string>',
    'CodeSize' => <integer>,
    'ConfigSha256' => '<string>',
    'DeadLetterConfig' => [
        'TargetArn' => '<string>',
    ],
    'Description' => '<string>',
    'DurableConfig' => [
        'ExecutionTimeout' => <integer>,
        'RetentionPeriodInDays' => <integer>,
    ],
    'Environment' => [
        'Error' => [
            'ErrorCode' => '<string>',
            'Message' => '<string>',
        ],
        'Variables' => ['<string>', ...],
    ],
    'EphemeralStorage' => [
        'Size' => <integer>,
    ],
    'FileSystemConfigs' => [
        [
            'Arn' => '<string>',
            'LocalMountPath' => '<string>',
        ],
        // ...
    ],
    '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|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
    '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|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|python3.9|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2|nodejs18.x|python3.10|java17|ruby3.2|ruby3.3|ruby3.4|python3.11|nodejs20.x|provided.al2023|python3.12|java21|python3.13|nodejs22.x|nodejs24.x|python3.14|java25',
    '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|DrainingDurableExecutions|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
    '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
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 /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).

FileSystemConfigs
Type: Array of FileSystemConfig structures

Connection settings for an Amazon EFS 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 Successful after 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 Image for container image and set Zip for .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.

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 ApplyOn to PublishedVersions to 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.

ResourceNotFoundException:

The resource specified in the request does not exist.

CodeStorageExceededException:

Your Amazon Web Services account has exceeded its maximum total code size. For more information, see Lambda quotas.

PreconditionFailedException:

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

  • For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

  • For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

FunctionVersionsPerCapacityProviderLimitExceededException:

The maximum number of function versions that can be associated with a single capacity provider has been exceeded. For more information, see Lambda quotas.

Examples

Example 1: To publish a version of a Lambda function

This operation publishes a version of a Lambda function

$result = $client->publishVersion([
    'CodeSha256' => '',
    'Description' => '',
    'FunctionName' => 'myFunction',
]);

Result syntax:

[
    'CodeSha256' => 'YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=',
    'CodeSize' => 5797206,
    'Description' => 'Process image objects from Amazon S3.',
    'Environment' => [
        'Variables' => [
            'BUCKET' => 'my-bucket-1xpuxmplzrlbh',
            'PREFIX' => 'inbound',
        ],
    ],
    'FunctionArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function',
    'FunctionName' => 'my-function',
    'Handler' => 'index.handler',
    'KMSKeyArn' => 'arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966',
    'LastModified' => '2020-04-10T19:06:32.563+0000',
    'LastUpdateStatus' => 'Successful',
    'MemorySize' => 256,
    'RevisionId' => 'b75dcd81-xmpl-48a8-a75a-93ba8b5b9727',
    'Role' => 'arn:aws:iam::123456789012:role/lambda-role',
    'Runtime' => 'nodejs12.x',
    'State' => 'Active',
    'Timeout' => 5,
    'TracingConfig' => [
        'Mode' => 'Active',
    ],
    'Version' => '1',
]

PutFunctionCodeSigningConfig

$result = $client->putFunctionCodeSigningConfig([/* ... */]);
$promise = $client->putFunctionCodeSigningConfigAsync([/* ... */]);

Update the code signing configuration for the function. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function.

Parameter Syntax

$result = $client->putFunctionCodeSigningConfig([
    'CodeSigningConfigArn' => '<string>', // REQUIRED
    'FunctionName' => '<string>', // REQUIRED
]);

Parameter Details

Members
CodeSigningConfigArn
Required: Yes
Type: string

The The Amazon Resource Name (ARN) of the code signing configuration.

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.

Result Syntax

[
    'CodeSigningConfigArn' => '<string>',
    'FunctionName' => '<string>',
]

Result Details

Members
CodeSigningConfigArn
Required: Yes
Type: string

The The Amazon Resource Name (ARN) of the code signing configuration.

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.

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.

CodeSigningConfigNotFoundException:

The specified code signing configuration does not exist.

PutFunctionConcurrency

$result = $client->putFunctionConcurrency([/* ... */]);
$promise = $client->putFunctionConcurrencyAsync([/* ... */]);

Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency level.

Concurrency settings apply to the function as a whole, including all published versions and the unpublished version. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level. Use GetFunction to see the current setting for a function.

Use GetAccountSettings to see your Regional concurrency limit. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per-function limit. For more information, see Lambda function scaling.

Parameter Syntax

$result = $client->putFunctionConcurrency([
    'FunctionName' => '<string>', // REQUIRED
    'ReservedConcurrentExecutions' => <integer>, // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

ReservedConcurrentExecutions
Required: Yes
Type: int

The number of simultaneous executions to reserve for the function.

Result Syntax

[
    'ReservedConcurrentExecutions' => <integer>,
]

Result Details

Members
ReservedConcurrentExecutions
Type: int

The number of concurrent executions that are reserved for this function. For more information, see Managing Lambda reserved concurrency.

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 configure a reserved concurrency limit for a function

The following example configures 100 reserved concurrent executions for the my-function function.

$result = $client->putFunctionConcurrency([
    'FunctionName' => 'my-function',
    'ReservedConcurrentExecutions' => 100,
]);

Result syntax:

[
    'ReservedConcurrentExecutions' => 100,
]

PutFunctionEventInvokeConfig

$result = $client->putFunctionEventInvokeConfig([/* ... */]);
$promise = $client->putFunctionEventInvokeConfigAsync([/* ... */]);

Configures options for asynchronous invocation on a function, version, or alias. If a configuration already exists for a function, version, or alias, this operation overwrites it. If you exclude any settings, they are removed. To set one option without affecting existing settings for other options, use UpdateFunctionEventInvokeConfig.

By default, Lambda retries an asynchronous invocation twice if the function returns an error. It retains events in a queue for up to six hours. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it. To retain discarded events, configure a dead-letter queue with UpdateFunctionConfiguration.

To send an invocation record to a queue, topic, S3 bucket, function, or event bus, specify a destination. You can configure separate destinations for successful invocations (on-success) and events that fail all processing attempts (on-failure). You can configure destinations in addition to or instead of a dead-letter queue.

S3 buckets are supported only for on-failure destinations. To retain records of successful invocations, use another destination type.

Parameter Syntax

$result = $client->putFunctionEventInvokeConfig([
    'DestinationConfig' => [
        'OnFailure' => [
            'Destination' => '<string>',
        ],
        'OnSuccess' => [
            'Destination' => '<string>',
        ],
    ],
    'FunctionName' => '<string>', // REQUIRED
    'MaximumEventAgeInSeconds' => <integer>,
    'MaximumRetryAttempts' => <integer>,
    'Qualifier' => '<string>',
]);

Parameter Details

Members
DestinationConfig
Type: DestinationConfig structure

A destination for events after they have been sent to a function for processing.

Destinations

  • Function - The Amazon Resource Name (ARN) of a Lambda function.

  • Queue - The ARN of a standard SQS queue.

  • Bucket - The ARN of an Amazon S3 bucket.

  • Topic - The ARN of a standard SNS topic.

  • Event Bus - The ARN of an Amazon EventBridge event bus.

S3 buckets are supported only for on-failure destinations. To retain records of successful invocations, use another destination type.

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.

MaximumEventAgeInSeconds
Type: int

The maximum age of a request that Lambda sends to a function for processing.

MaximumRetryAttempts
Type: int

The maximum number of times to retry when the function returns an error.

Qualifier
Type: string

A version number or alias name.

Result Syntax

[
    'DestinationConfig' => [
        'OnFailure' => [
            'Destination' => '<string>',
        ],
        'OnSuccess' => [
            'Destination' => '<string>',
        ],
    ],
    'FunctionArn' => '<string>',
    'LastModified' => <DateTime>,
    'MaximumEventAgeInSeconds' => <integer>,
    'MaximumRetryAttempts' => <integer>,
]

Result Details

Members
DestinationConfig
Type: DestinationConfig structure

A destination for events after they have been sent to a function for processing.

Destinations

  • Function - The Amazon Resource Name (ARN) of a Lambda function.

  • Queue - The ARN of a standard SQS queue.

  • Bucket - The ARN of an Amazon S3 bucket.

  • Topic - The ARN of a standard SNS topic.

  • Event Bus - The ARN of an Amazon EventBridge event bus.

S3 buckets are supported only for on-failure destinations. To retain records of successful invocations, use another destination type.

FunctionArn
Type: string

The Amazon Resource Name (ARN) of the function.

LastModified
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time that the configuration was last updated.

MaximumEventAgeInSeconds
Type: int

The maximum age of a request that Lambda sends to a function for processing.

MaximumRetryAttempts
Type: int

The maximum number of times to retry when the function returns an error.

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 configure error handling for asynchronous invocation

The following example sets a maximum event age of one hour and disables retries for the specified function.

$result = $client->putFunctionEventInvokeConfig([
    'FunctionName' => 'my-function',
    'MaximumEventAgeInSeconds' => 3600,
    'MaximumRetryAttempts' => 0,
]);

Result syntax:

[
    'DestinationConfig' => [
        'OnFailure' => [
        ],
        'OnSuccess' => [
        ],
    ],
    'FunctionArn' => 'arn:aws:lambda:us-east-2:123456789012:function:my-function:$LATEST',
    'LastModified' => ,
    'MaximumEventAgeInSeconds' => 3600,
    'MaximumRetryAttempts' => 0,
]

PutFunctionRecursionConfig

$result = $client->putFunctionRecursionConfig([/* ... */]);
$promise = $client->putFunctionRecursionConfigAsync([/* ... */]);

Sets your function's recursive loop detection configuration.

When you configure a Lambda function to output to the same service or resource that invokes the function, it's possible to create an infinite recursive loop. For example, a Lambda function might write a message to an Amazon Simple Queue Service (Amazon SQS) queue, which then invokes the same function. This invocation causes the function to write another message to the queue, which in turn invokes the function again.

Lambda can detect certain types of recursive loops shortly after they occur. When Lambda detects a recursive loop and your function's recursive loop detection configuration is set to Terminate, it stops your function being invoked and notifies you.

Parameter Syntax

$result = $client->putFunctionRecursionConfig([
    'FunctionName' => '<string>', // REQUIRED
    'RecursiveLoop' => 'Allow|Terminate', // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

RecursiveLoop
Required: Yes
Type: string

If you set your function's recursive loop detection configuration to Allow, Lambda doesn't take any action when it detects your function being invoked as part of a recursive loop. We recommend that you only use this setting if your design intentionally uses a Lambda function to write data back to the same Amazon Web Services resource that invokes it.

If you set your function's recursive loop detection configuration to Terminate, Lambda stops your function being invoked and notifies you when it detects your function being invoked as part of a recursive loop.

By default, Lambda sets your function's configuration to Terminate.

If your design intentionally uses a Lambda function to write data back to the same Amazon Web Services resource that invokes the function, then use caution and implement suitable guard rails to prevent unexpected charges being billed to your Amazon Web Services account. To learn more about best practices for using recursive invocation patterns, see Recursive patterns that cause run-away Lambda functions in Serverless Land.

Result Syntax

[
    'RecursiveLoop' => 'Allow|Terminate',
]

Result Details

Members
RecursiveLoop
Type: string

The status of your function's recursive loop detection configuration.

When this value is set to Allowand Lambda detects your function being invoked as part of a recursive loop, it doesn't take any action.

When this value is set to Terminate and Lambda detects your function being invoked as part of a recursive loop, it stops your function being invoked and notifies you.

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.

PutFunctionScalingConfig

$result = $client->putFunctionScalingConfig([/* ... */]);
$promise = $client->putFunctionScalingConfigAsync([/* ... */]);

Sets the scaling configuration for a Lambda Managed Instances function. The scaling configuration defines the minimum and maximum number of execution environments that can be provisioned for the function, allowing you to control scaling behavior and resource allocation.

Parameter Syntax

$result = $client->putFunctionScalingConfig([
    'FunctionName' => '<string>', // REQUIRED
    'FunctionScalingConfig' => [
        'MaxExecutionEnvironments' => <integer>,
        'MinExecutionEnvironments' => <integer>,
    ],
    'Qualifier' => '<string>', // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

FunctionScalingConfig
Type: FunctionScalingConfig structure

The scaling configuration to apply to the function, including minimum and maximum execution environment limits.

Qualifier
Required: Yes
Type: string

Specify a version or alias to set the scaling configuration for a published version of the function.

Result Syntax

[
    'FunctionState' => 'Pending|Active|Inactive|Failed|Deactivating|Deactivated|ActiveNonInvocable|Deleting',
]

Result Details

Members
FunctionState
Type: string

The current state of the function after applying the scaling 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.

ResourceNotFoundException:

The resource specified in the request does not exist.

PutProvisionedConcurrencyConfig

$result = $client->putProvisionedConcurrencyConfig([/* ... */]);
$promise = $client->putProvisionedConcurrencyConfigAsync([/* ... */]);

Adds a provisioned concurrency configuration to a function's alias or version.

Parameter Syntax

$result = $client->putProvisionedConcurrencyConfig([
    'FunctionName' => '<string>', // REQUIRED
    'ProvisionedConcurrentExecutions' => <integer>, // REQUIRED
    'Qualifier' => '<string>', // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

ProvisionedConcurrentExecutions
Required: Yes
Type: int

The amount of provisioned concurrency to allocate for the version or alias.

Qualifier
Required: Yes
Type: string

The version number or alias name.

Result Syntax

[
    'AllocatedProvisionedConcurrentExecutions' => <integer>,
    'AvailableProvisionedConcurrentExecutions' => <integer>,
    'LastModified' => '<string>',
    'RequestedProvisionedConcurrentExecutions' => <integer>,
    'Status' => 'IN_PROGRESS|READY|FAILED',
    'StatusReason' => '<string>',
]

Result Details

Members
AllocatedProvisionedConcurrentExecutions
Type: int

The amount of provisioned concurrency allocated. When a weighted alias is used during linear and canary deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function versions.

AvailableProvisionedConcurrentExecutions
Type: int

The amount of provisioned concurrency available.

LastModified
Type: string

The date and time that a user last updated the configuration, in ISO 8601 format.

RequestedProvisionedConcurrentExecutions
Type: int

The amount of provisioned concurrency requested.

Status
Type: string

The status of the allocation process.

StatusReason
Type: string

For failed allocations, the reason that provisioned concurrency could not be allocated.

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 allocate provisioned concurrency

The following example allocates 100 provisioned concurrency for the BLUE alias of the specified function.

$result = $client->putProvisionedConcurrencyConfig([
    'FunctionName' => 'my-function',
    'ProvisionedConcurrentExecutions' => 100,
    'Qualifier' => 'BLUE',
]);

Result syntax:

[
    'AllocatedProvisionedConcurrentExecutions' => 0,
    'LastModified' => '2019-11-21T19:32:12+0000',
    'RequestedProvisionedConcurrentExecutions' => 100,
    'Status' => 'IN_PROGRESS',
]

PutRuntimeManagementConfig

$result = $client->putRuntimeManagementConfig([/* ... */]);
$promise = $client->putRuntimeManagementConfigAsync([/* ... */]);

Sets the runtime management configuration for a function's version. For more information, see Runtime updates.

Parameter Syntax

$result = $client->putRuntimeManagementConfig([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>',
    'RuntimeVersionArn' => '<string>',
    'UpdateRuntimeOn' => 'Auto|Manual|FunctionUpdate', // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Qualifier
Type: string

Specify a version of the function. This can be $LATEST or a published version number. If no value is specified, the configuration for the $LATEST version is returned.

RuntimeVersionArn
Type: string

The ARN of the runtime version you want the function to use.

This is only required if you're using the Manual runtime update mode.

UpdateRuntimeOn
Required: Yes
Type: string

Specify the runtime update mode.

  • Auto (default) - Automatically update to the most recent and secure runtime version using a Two-phase runtime version rollout. This is the best choice for most customers to ensure they always benefit from runtime updates.

  • Function update - Lambda updates the runtime of your function to the most recent and secure runtime version when you update your function. This approach synchronizes runtime updates with function deployments, giving you control over when runtime updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When using this setting, you need to regularly update your functions to keep their runtime up-to-date.

  • Manual - You specify a runtime version in your function configuration. The function will use this runtime version indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows you to roll back your function to an earlier runtime version. For more information, see Roll back a runtime version.

Result Syntax

[
    'FunctionArn' => '<string>',
    'RuntimeVersionArn' => '<string>',
    'UpdateRuntimeOn' => 'Auto|Manual|FunctionUpdate',
]

Result Details

Members
FunctionArn
Required: Yes
Type: string

The ARN of the function

RuntimeVersionArn
Type: string

The ARN of the runtime the function is configured to use. If the runtime update mode is manual, the ARN is returned, otherwise null is returned.

UpdateRuntimeOn
Required: Yes
Type: string

The runtime update mode.

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.

RemoveLayerVersionPermission

$result = $client->removeLayerVersionPermission([/* ... */]);
$promise = $client->removeLayerVersionPermissionAsync([/* ... */]);

Removes a statement from the permissions policy for a version of an Lambda layer. For more information, see AddLayerVersionPermission.

Parameter Syntax

$result = $client->removeLayerVersionPermission([
    'LayerName' => '<string>', // REQUIRED
    'RevisionId' => '<string>',
    'StatementId' => '<string>', // REQUIRED
    'VersionNumber' => <integer>, // REQUIRED
]);

Parameter Details

Members
LayerName
Required: Yes
Type: string

The name or Amazon Resource Name (ARN) of the 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

The identifier that was specified when the statement was added.

VersionNumber
Required: Yes
Type: long (int|float)

The version number.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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.

PreconditionFailedException:

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

  • For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

  • For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

Examples

Example 1: To delete layer-version permissions

The following example deletes permission for an account to configure a layer version.

$result = $client->removeLayerVersionPermission([
    'LayerName' => 'my-layer',
    'StatementId' => 'xaccount',
    'VersionNumber' => 1,
]);

RemovePermission

$result = $client->removePermission([/* ... */]);
$promise = $client->removePermissionAsync([/* ... */]);

Revokes function-use permission from an Amazon Web Services service or another Amazon Web Services account. You can get the ID of the statement from the output of GetPolicy.

Parameter Syntax

$result = $client->removePermission([
    'FunctionName' => '<string>', // REQUIRED
    'Qualifier' => '<string>',
    'RevisionId' => '<string>',
    'StatementId' => '<string>', // REQUIRED
]);

Parameter Details

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function, version, or alias.

Name formats

  • Function namemy-function (name-only), my-function:v1 (with alias).

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

Qualifier
Type: string

Specify a version or alias to remove permissions from 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.

StatementId
Required: Yes
Type: string

Statement ID of the permission to remove.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

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.

PreconditionFailedException:

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

  • For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

  • For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

Examples

Example 1: To remove a Lambda function's permissions

The following example removes a permissions statement named xaccount from the PROD alias of a function named my-function.

$result = $client->removePermission([
    'FunctionName' => 'my-function',
    'Qualifier' => 'PROD',
    'StatementId' => 'xaccount',
]);

SendDurableExecutionCallbackFailure

$result = $client->sendDurableExecutionCallbackFailure([/* ... */]);
$promise = $client->sendDurableExecutionCallbackFailureAsync([/* ... */]);

Sends a failure response for a callback operation in a durable execution. Use this API when an external system cannot complete a callback operation successfully.

Parameter Syntax

$result = $client->sendDurableExecutionCallbackFailure([
    'CallbackId' => '<string>', // REQUIRED
    'Error' => [
        'ErrorData' => '<string>',
        'ErrorMessage' => '<string>',
        'ErrorType' => '<string>',
        'StackTrace' => ['<string>', ...],
    ],
]);

Parameter Details

Members
CallbackId
Required: Yes
Type: string

The unique identifier for the callback operation.

Error
Type: ErrorObject structure

Error details describing why the callback operation failed.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

ServiceException:

The Lambda service encountered an internal error.

CallbackTimeoutException:

The callback ID token has either expired or the callback associated with the token has already been closed.

SendDurableExecutionCallbackHeartbeat

$result = $client->sendDurableExecutionCallbackHeartbeat([/* ... */]);
$promise = $client->sendDurableExecutionCallbackHeartbeatAsync([/* ... */]);

Sends a heartbeat signal for a long-running callback operation to prevent timeout. Use this API to extend the callback timeout period while the external operation is still in progress.

Parameter Syntax

$result = $client->sendDurableExecutionCallbackHeartbeat([
    'CallbackId' => '<string>', // REQUIRED
]);

Parameter Details

Members
CallbackId
Required: Yes
Type: string

The unique identifier for the callback operation.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

ServiceException:

The Lambda service encountered an internal error.

CallbackTimeoutException:

The callback ID token has either expired or the callback associated with the token has already been closed.

SendDurableExecutionCallbackSuccess

$result = $client->sendDurableExecutionCallbackSuccess([/* ... */]);
$promise = $client->sendDurableExecutionCallbackSuccessAsync([/* ... */]);

Sends a successful completion response for a callback operation in a durable execution. Use this API when an external system has successfully completed a callback operation.

Parameter Syntax

$result = $client->sendDurableExecutionCallbackSuccess([
    'CallbackId' => '<string>', // REQUIRED
    'Result' => <string || resource || Psr\Http\Message\StreamInterface>,
]);

Parameter Details

Members
CallbackId
Required: Yes
Type: string

The unique identifier for the callback operation.

Result
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

The result data from the successful callback operation. Maximum size is 256 KB.

Result Syntax

[]

Result Details

The results for this operation are always empty.

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

ServiceException:

The Lambda service encountered an internal error.

CallbackTimeoutException:

The callback ID token has either expired or the callback associated with the token has already been closed.

StopDurableExecution

$result = $client->stopDurableExecution([/* ... */]);
$promise = $client->stopDurableExecutionAsync([/* ... */]);

Stops a running durable execution. The execution transitions to STOPPED status and cannot be resumed. Any in-progress operations are terminated.

Parameter Syntax

$result = $client->stopDurableExecution([
    'DurableExecutionArn' => '<string>', // REQUIRED
    'Error' => [
        'ErrorData' => '<string>',
        'ErrorMessage' => '<string>',
        'ErrorType' => '<string>',
        'StackTrace' => ['<string>', ...],
    ],
]);

Parameter Details

Members
DurableExecutionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the durable execution.

Error
Type: ErrorObject structure

Optional error details explaining why the execution is being stopped.

Result Syntax

[
    'StopTimestamp' => <DateTime>,
]

Result Details

Members
StopTimestamp
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The timestamp when the execution was stopped (ISO 8601 format).

Errors

InvalidParameterValueException:

One of the parameters in the request is not valid.

TooManyRequestsException:

The request throughput limit was exceeded. For more information, see Lambda quotas.

ServiceException:

The Lambda service encountered an internal error.

ResourceNotFoundException:

The resource specified in the request does not exist.

TagResource

$result = $client->tagResource([/* ... */]);
$promise = $client->tagResourceAsync([/* ... */]);

Adds tags to a function, event source mapping, or code signing configuration.

Parameter Syntax

$result = $client->tagResource([
    'Resource' => '<string>', // REQUIRED
    'Tags' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
Resource
Required: Yes
Type: string

The resource's Amazon Resource Name (ARN).

Tags
Required: Yes
Type: Associative array of custom strings keys (TagKey) to strings

A list of tags to apply to the resource.

Result Syntax

[]

Result Details

The results for this operation are always empty.

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 add tags to an existing Lambda function

The following example adds a tag with the key name DEPARTMENT and a value of 'Department A' to the specified Lambda function.

$result = $client->tagResource([
    'Resource' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function',
    'Tags' => [
        'DEPARTMENT' => 'Department A',
    ],
]);

UntagResource

$result = $client->untagResource([/* ... */]);
$promise = $client->untagResourceAsync([/* ... */]);

Removes tags from a function, event source mapping, or code signing configuration.

Parameter Syntax

$result = $client->untagResource([
    'Resource' => '<string>', // REQUIRED
    'TagKeys' => ['<string>', ...], // REQUIRED
]);

Parameter Details

Members
Resource
Required: Yes
Type: string

The resource's Amazon Resource Name (ARN).

TagKeys
Required: Yes
Type: Array of strings

A list of tag keys to remove from the resource.

Result Syntax

[]

Result Details

The results for this operation are always empty.

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 remove tags from an existing Lambda function

The following example removes the tag with the key name DEPARTMENT tag from the my-function Lambda function.

$result = $client->untagResource([
    'Resource' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function',
    'TagKeys' => [
        'DEPARTMENT',
    ],
]);

UpdateAlias

$result = $client->updateAlias([/* ... */]);
$promise = $client->updateAliasAsync([/* ... */]);

Updates the configuration of a Lambda function alias.

Parameter Syntax

$result = $client->updateAlias([
    'Description' => '<string>',
    'FunctionName' => '<string>', // REQUIRED
    'FunctionVersion' => '<string>',
    'Name' => '<string>', // REQUIRED
    'RevisionId' => '<string>',
    '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
Type: string

The function version that the alias invokes.

Name
Required: Yes
Type: string

The name of the alias.

RevisionId
Type: string

Only update the alias if the revision ID matches the ID that's specified. Use this option to avoid modifying an alias that has changed since you last read it.

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.

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 GetPolicy to retrieve the latest RevisionId for your resource.

  • For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

Examples

Example 1: To update a function alias

The following example updates the alias named BLUE to send 30% of traffic to version 2 and 70% to version 1.

$result = $client->updateAlias([
    'FunctionName' => 'my-function',
    'FunctionVersion' => '2',
    'Name' => 'BLUE',
    'RoutingConfig' => [
        'AdditionalVersionWeights' => [
            '0' => 0.7,
        ],
    ],
]);

Result syntax:

[
    'AliasArn' => 'arn:aws:lambda:us-west-2:123456789012:function:my-function:BLUE',
    'Description' => 'Production environment BLUE.',
    'FunctionVersion' => '2',
    'Name' => 'BLUE',
    'RevisionId' => '594f41fb-xmpl-4c20-95c7-6ca5f2a92c93',
    'RoutingConfig' => [
        'AdditionalVersionWeights' => [
            '0' => 0.7,
        ],
    ],
]

UpdateCapacityProvider

$result = $client->updateCapacityProvider([/* ... */]);
$promise = $client->updateCapacityProviderAsync([/* ... */]);

Updates the configuration of an existing capacity provider.

Parameter Syntax

$result = $client->updateCapacityProvider([
    'CapacityProviderName' => '<string>', // REQUIRED
    'CapacityProviderScalingConfig' => [
        'MaxVCpuCount' => <integer>,
        'ScalingMode' => 'Auto|Manual',
        'ScalingPolicies' => [
            [
                'PredefinedMetricType' => 'LambdaCapacityProviderAverageCPUUtilization', // REQUIRED
                'TargetValue' => <float>, // REQUIRED
            ],
            // ...
        ],
    ],
]);

Parameter Details

Members
CapacityProviderName
Required: Yes
Type: string

The name of the capacity provider to update.

CapacityProviderScalingConfig

The updated scaling configuration for the capacity provider.

Result Syntax

[
    'CapacityProvider' => [
        'CapacityProviderArn' => '<string>',
        'CapacityProviderScalingConfig' => [
            'MaxVCpuCount' => <integer>,
            'ScalingMode' => 'Auto|Manual',
            'ScalingPolicies' => [
                [
                    'PredefinedMetricType' => 'LambdaCapacityProviderAverageCPUUtilization',
                    'TargetValue' => <float>,
                ],
                // ...
            ],
        ],
        'InstanceRequirements' => [
            'AllowedInstanceTypes' => ['<string>', ...],
            'Architectures' => ['<string>', ...],
            'ExcludedInstanceTypes' => ['<string>', ...],
        ],
        'KmsKeyArn' => '<string>',
        'LastModified' => '<string>',
        'PermissionsConfig' => [
            'CapacityProviderOperatorRoleArn' => '<string>',
        ],
        'State' => 'Pending|Active|Failed|Deleting',
        'VpcConfig' => [
            'SecurityGroupIds' => ['<string>', ...],
            'SubnetIds' => ['<string>', ...],
        ],
    ],
]

Result Details

Members
CapacityProvider
Required: Yes
Type: CapacityProvider structure

Information about the updated capacity provider.

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.

UpdateCodeSigningConfig

$result = $client->updateCodeSigningConfig([/* ... */]);
$promise = $client->updateCodeSigningConfigAsync([/* ... */]);

Update the code signing configuration. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function.

Parameter Syntax

$result = $client->updateCodeSigningConfig([
    'AllowedPublishers' => [
        'SigningProfileVersionArns' => ['<string>', ...], // REQUIRED
    ],
    'CodeSigningConfigArn' => '<string>', // REQUIRED
    'CodeSigningPolicies' => [
        'UntrustedArtifactOnDeployment' => 'Warn|Enforce',
    ],
    'Description' => '<string>',
]);

Parameter Details

Members
AllowedPublishers
Type: AllowedPublishers structure

Signing profiles for this code signing configuration.

CodeSigningConfigArn
Required: Yes
Type: string

The The Amazon Resource Name (ARN) of the code signing configuration.

CodeSigningPolicies
Type: CodeSigningPolicies structure

The code signing policy.

Description
Type: string

Descriptive name for this 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.

ResourceNotFoundException:

The resource specified in the request does not exist.

UpdateEventSourceMapping

$result = $client->updateEventSourceMapping([/* ... */]);
$promise = $client->updateEventSourceMappingAsync([/* ... */]);

Updates an event source mapping. You can change the function that Lambda invokes, or pause invocation and resume later from the same location.

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->updateEventSourceMapping([
    'AmazonManagedKafkaEventSourceConfig' => [
        'ConsumerGroupId' => '<string>',
        'SchemaRegistryConfig' => [
            'AccessConfigs' => [
                [
                    'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE',
                    '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,
    'FilterCriteria' => [
        'Filters' => [
            [
                'Pattern' => '<string>',
            ],
            // ...
        ],
    ],
    'FunctionName' => '<string>',
    'FunctionResponseTypes' => ['<string>', ...],
    'KMSKeyArn' => '<string>',
    'MaximumBatchingWindowInSeconds' => <integer>,
    'MaximumRecordAgeInSeconds' => <integer>,
    'MaximumRetryAttempts' => <integer>,
    'MetricsConfig' => [
        'Metrics' => ['<string>', ...],
    ],
    'ParallelizationFactor' => <integer>,
    'ProvisionedPollerConfig' => [
        'MaximumPollers' => <integer>,
        'MinimumPollers' => <integer>,
        'PollerGroupName' => '<string>',
    ],
    'ScalingConfig' => [
        'MaximumConcurrency' => <integer>,
    ],
    'SelfManagedKafkaEventSourceConfig' => [
        'ConsumerGroupId' => '<string>',
        'SchemaRegistryConfig' => [
            'AccessConfigs' => [
                [
                    'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE',
                    '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',
            'URI' => '<string>',
        ],
        // ...
    ],
    'TumblingWindowInSeconds' => <integer>,
    'UUID' => '<string>', // REQUIRED
]);

Parameter Details

Members
AmazonManagedKafkaEventSourceConfig

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

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
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function nameMyFunction.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction.

  • Version or Alias ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.

  • Partial ARN123456789012: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.

MaximumBatchingWindowInSeconds
Type: int

The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure MaximumBatchingWindowInSeconds to 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 MaximumBatchingWindowInSeconds in 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 BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to 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 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.

MetricsConfig

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.

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.

SelfManagedKafkaEventSourceConfig

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.

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
Required: Yes
Type: string

The identifier of the event source mapping.

Result Syntax

[
    'AmazonManagedKafkaEventSourceConfig' => [
        'ConsumerGroupId' => '<string>',
        'SchemaRegistryConfig' => [
            'AccessConfigs' => [
                [
                    'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE',
                    '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>',
    '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>',
        'SchemaRegistryConfig' => [
            'AccessConfigs' => [
                [
                    'Type' => 'BASIC_AUTH|CLIENT_CERTIFICATE_TLS_AUTH|SERVER_ROOT_CA_CERTIFICATE',
                    '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',
            'URI' => '<string>',
        ],
        // ...
    ],
    'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP',
    'StartingPositionTimestamp' => <DateTime>,
    'State' => '<string>',
    'StateTransitionReason' => '<string>',
    'Topics' => ['<string>', ...],
    'TumblingWindowInSeconds' => <integer>,
    'UUID' => '<string>',
]

Result Details

Members
AmazonManagedKafkaEventSourceConfig

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 BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to 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 null in the response of ListEventSourceMapping API calls. You can view this field in plaintext in the response of GetEventSourceMapping and DeleteEventSourceMapping calls if you have kms:Decrypt permissions 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.

MaximumBatchingWindowInSeconds
Type: int

The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure MaximumBatchingWindowInSeconds to 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 MaximumBatchingWindowInSeconds in 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 BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to 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

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

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_TIMESTAMP is 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 StartingPosition set to AT_TIMESTAMP, the time from which to start reading. StartingPositionTimestamp cannot 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, or Deleting.

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.

ResourceInUseException:

The operation conflicts with the resource's availability. For example, you tried to update an event source mapping in the CREATING state, or you tried to delete an event source mapping currently UPDATING.

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 update a Lambda function event source mapping

This operation updates a Lambda function event source mapping

$result = $client->updateEventSourceMapping([
    'BatchSize' => 123,
    'Enabled' => 1,
    'FunctionName' => 'myFunction',
    'UUID' => '1234xCy789012',
]);

Result syntax:

[
    'BatchSize' => 123,
    'EventSourceArn' => 'arn:aws:s3:::examplebucket/*',
    'FunctionArn' => 'arn:aws:lambda:us-west-2:123456789012:function:myFunction',
    'LastModified' => ,
    'LastProcessingResult' => '',
    'State' => '',
    'StateTransitionReason' => '',
    'UUID' => '1234xCy789012',
]

UpdateFunctionCode

$result = $client->updateFunctionCode([/* ... */]);
$promise = $client->updateFunctionCodeAsync([/* ... */]);

Updates a Lambda function's code. If code signing is enabled for the function, the code package must be signed by a trusted publisher. For more information, see Configuring code signing for Lambda.

If the function's package type is Image, then you must specify the code package in ImageUri as the URI of a container image in the Amazon ECR registry.

If the function's package type is Zip, then you must specify the deployment package as a .zip file archive. Enter the Amazon S3 bucket and key of the code .zip file location. You can also provide the function code inline using the ZipFile field.

The code in the deployment package must be compatible with the target instruction set architecture of the function (x86-64 or arm64).

The function's code is locked when you publish a version. You can't modify the code of a published version, only the unpublished version.

For a function defined as a container image, Lambda resolves the image tag to an image digest. In Amazon ECR, if you update the image tag to a new image, Lambda does not automatically update the function.

Parameter Syntax

$result = $client->updateFunctionCode([
    'Architectures' => ['<string>', ...],
    'DryRun' => true || false,
    'FunctionName' => '<string>', // REQUIRED
    'ImageUri' => '<string>',
    'Publish' => true || false,
    'PublishTo' => 'LATEST_PUBLISHED',
    'RevisionId' => '<string>',
    'S3Bucket' => '<string>',
    'S3Key' => '<string>',
    'S3ObjectVersion' => '<string>',
    'SourceKMSKeyArn' => '<string>',
    'ZipFile' => <string || resource || Psr\Http\Message\StreamInterface>,
]);

Parameter Details

Members
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.

DryRun
Type: boolean

Set to true to validate the request parameters and access permissions without modifying the function code.

FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

ImageUri
Type: string

URI of a container image in the Amazon ECR registry. Do not use for a function defined with a .zip file archive.

Publish
Type: boolean

Set to true to publish a new version of the function after updating the code. This has the same effect as calling PublishVersion separately.

PublishTo
Type: string

Specifies where to publish the function version or configuration.

RevisionId
Type: string

Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.

S3Bucket
Type: string

An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account. Use only with a function defined with a .zip file archive deployment package.

S3Key
Type: string

The Amazon S3 key of the deployment package. Use only with a function defined with a .zip file archive deployment package.

S3ObjectVersion
Type: string

For versioned objects, the version of the deployment package object to use.

SourceKMSKeyArn
Type: string

The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's .zip deployment package. If you don't provide a customer managed key, Lambda uses an Amazon Web Services managed key.

ZipFile
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you. Use only with a function defined with a .zip file archive deployment package.

Result Syntax

[
    'Architectures' => ['<string>', ...],
    'CapacityProviderConfig' => [
        'LambdaManagedInstancesCapacityProviderConfig' => [
            'CapacityProviderArn' => '<string>',
            'ExecutionEnvironmentMemoryGiBPerVCpu' => <float>,
            'PerExecutionEnvironmentMaxConcurrency' => <integer>,
        ],
    ],
    'CodeSha256' => '<string>',
    'CodeSize' => <integer>,
    'ConfigSha256' => '<string>',
    'DeadLetterConfig' => [
        'TargetArn' => '<string>',
    ],
    'Description' => '<string>',
    'DurableConfig' => [
        'ExecutionTimeout' => <integer>,
        'RetentionPeriodInDays' => <integer>,
    ],
    'Environment' => [
        'Error' => [
            'ErrorCode' => '<string>',
            'Message' => '<string>',
        ],
        'Variables' => ['<string>', ...],
    ],
    'EphemeralStorage' => [
        'Size' => <integer>,
    ],
    'FileSystemConfigs' => [
        [
            'Arn' => '<string>',
            'LocalMountPath' => '<string>',
        ],
        // ...
    ],
    '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|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
    '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|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|python3.9|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2|nodejs18.x|python3.10|java17|ruby3.2|ruby3.3|ruby3.4|python3.11|nodejs20.x|provided.al2023|python3.12|java21|python3.13|nodejs22.x|nodejs24.x|python3.14|java25',
    '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|DrainingDurableExecutions|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
    '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
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 /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).

FileSystemConfigs
Type: Array of FileSystemConfig structures

Connection settings for an Amazon EFS 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 Successful after 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 Image for container image and set Zip for .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.

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 ApplyOn to PublishedVersions to 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 Lambda quotas.

PreconditionFailedException:

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

  • For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

  • For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

Examples

Example 1: To update a Lambda function's code

The following example replaces the code of the unpublished ($LATEST) version of a function named my-function with the contents of the specified zip file in Amazon S3.

$result = $client->updateFunctionCode([
    'FunctionName' => 'my-function',
    'S3Bucket' => 'my-bucket-1xpuxmplzrlbh',
    'S3Key' => 'function.zip',
]);

Result syntax:

[
    'CodeSha256' => 'PFn4S+er27qk+UuZSTKEQfNKG/XNn7QJs90mJgq6oH8=',
    'CodeSize' => 308,
    'Description' => '',
    'FunctionArn' => 'arn:aws:lambda:us-east-2:123456789012:function:my-function',
    'FunctionName' => 'my-function',
    'Handler' => 'index.handler',
    'LastModified' => '2019-08-14T22:26:11.234+0000',
    'MemorySize' => 128,
    'RevisionId' => '873282ed-xmpl-4dc8-a069-d0c647e470c6',
    'Role' => 'arn:aws:iam::123456789012:role/lambda-role',
    'Runtime' => 'nodejs12.x',
    'Timeout' => 3,
    'TracingConfig' => [
        'Mode' => 'PassThrough',
    ],
    'Version' => '$LATEST',
]

UpdateFunctionConfiguration

$result = $client->updateFunctionConfiguration([/* ... */]);
$promise = $client->updateFunctionConfigurationAsync([/* ... */]);

Modify the version-specific settings of a Lambda function.

When you update 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. During this time, you can't modify the function, but you can still invoke it. The LastUpdateStatus, LastUpdateStatusReason, and LastUpdateStatusReasonCode fields in the response from GetFunctionConfiguration indicate when the update is complete and the function is processing events with the new configuration. For more information, see Lambda function states.

These settings can vary between versions of a function and are locked when you publish a version. You can't modify the configuration of a published version, only the unpublished version.

To configure function concurrency, use PutFunctionConcurrency. To grant invoke permissions to an Amazon Web Services account or Amazon Web Services service, use AddPermission.

Parameter Syntax

$result = $client->updateFunctionConfiguration([
    'CapacityProviderConfig' => [
        'LambdaManagedInstancesCapacityProviderConfig' => [ // REQUIRED
            'CapacityProviderArn' => '<string>', // REQUIRED
            'ExecutionEnvironmentMemoryGiBPerVCpu' => <float>,
            'PerExecutionEnvironmentMaxConcurrency' => <integer>,
        ],
    ],
    'DeadLetterConfig' => [
        'TargetArn' => '<string>',
    ],
    'Description' => '<string>',
    'DurableConfig' => [
        'ExecutionTimeout' => <integer>,
        'RetentionPeriodInDays' => <integer>,
    ],
    'Environment' => [
        'Variables' => ['<string>', ...],
    ],
    'EphemeralStorage' => [
        'Size' => <integer>, // REQUIRED
    ],
    'FileSystemConfigs' => [
        [
            'Arn' => '<string>', // REQUIRED
            'LocalMountPath' => '<string>', // REQUIRED
        ],
        // ...
    ],
    '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>,
    'RevisionId' => '<string>',
    'Role' => '<string>',
    'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|nodejs14.x|nodejs16.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|python3.9|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2|nodejs18.x|python3.10|java17|ruby3.2|ruby3.3|ruby3.4|python3.11|nodejs20.x|provided.al2023|python3.12|java21|python3.13|nodejs22.x|nodejs24.x|python3.14|java25',
    'SnapStart' => [
        'ApplyOn' => 'PublishedVersions|None',
    ],
    'Timeout' => <integer>,
    'TracingConfig' => [
        'Mode' => 'Active|PassThrough',
    ],
    'VpcConfig' => [
        'Ipv6AllowedForDualStack' => true || false,
        'SecurityGroupIds' => ['<string>', ...],
        'SubnetIds' => ['<string>', ...],
    ],
]);

Parameter Details

Members
CapacityProviderConfig
Type: CapacityProviderConfig structure

Configuration for the capacity provider that manages compute resources for Lambda functions.

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. Allows updating execution timeout and retention period for functions with durability enabled.

Environment
Type: Environment structure

Environment variables that are accessible from function code during execution.

EphemeralStorage
Type: EphemeralStorage structure

The size of the function's /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).

FileSystemConfigs
Type: Array of FileSystemConfig structures

Connection settings for an Amazon EFS file system.

FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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 Docker file.

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.

RevisionId
Type: string

Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.

Role
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.

SnapStart
Type: SnapStart structure

The function's SnapStart setting.

Timeout
Type: int

The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see Lambda execution environment.

TracingConfig
Type: TracingConfig structure

Set Mode to Active to 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

[
    'Architectures' => ['<string>', ...],
    'CapacityProviderConfig' => [
        'LambdaManagedInstancesCapacityProviderConfig' => [
            'CapacityProviderArn' => '<string>',
            'ExecutionEnvironmentMemoryGiBPerVCpu' => <float>,
            'PerExecutionEnvironmentMaxConcurrency' => <integer>,
        ],
    ],
    'CodeSha256' => '<string>',
    'CodeSize' => <integer>,
    'ConfigSha256' => '<string>',
    'DeadLetterConfig' => [
        'TargetArn' => '<string>',
    ],
    'Description' => '<string>',
    'DurableConfig' => [
        'ExecutionTimeout' => <integer>,
        'RetentionPeriodInDays' => <integer>,
    ],
    'Environment' => [
        'Error' => [
            'ErrorCode' => '<string>',
            'Message' => '<string>',
        ],
        'Variables' => ['<string>', ...],
    ],
    'EphemeralStorage' => [
        'Size' => <integer>,
    ],
    'FileSystemConfigs' => [
        [
            'Arn' => '<string>',
            'LocalMountPath' => '<string>',
        ],
        // ...
    ],
    '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|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
    '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|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|python3.9|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|dotnet6|dotnet8|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2|nodejs18.x|python3.10|java17|ruby3.2|ruby3.3|ruby3.4|python3.11|nodejs20.x|provided.al2023|python3.12|java21|python3.13|nodejs22.x|nodejs24.x|python3.14|java25',
    '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|DrainingDurableExecutions|VcpuLimitExceeded|CapacityProviderScalingLimitExceeded|InsufficientCapacity|EC2RequestLimitExceeded|FunctionError.InitTimeout|FunctionError.RuntimeInitError|FunctionError.ExtensionInitError|FunctionError.InvalidEntryPoint|FunctionError.InvalidWorkingDirectory|FunctionError.PermissionDenied|FunctionError.TooManyExtensions|FunctionError.InitResourceExhausted|DisallowedByVpcEncryptionControl',
    '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
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 /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).

FileSystemConfigs
Type: Array of FileSystemConfig structures

Connection settings for an Amazon EFS 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 Successful after 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 Image for container image and set Zip for .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.

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 ApplyOn to PublishedVersions to 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.

PreconditionFailedException:

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

  • For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

  • For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

Examples

Example 1: To update a Lambda function's configuration

The following example modifies the memory size to be 256 MB for the unpublished ($LATEST) version of a function named my-function.

$result = $client->updateFunctionConfiguration([
    'DurableConfig' => [
        'ExecutionTimeout' => 3600,
        'RetentionPeriodInDays' => 45,
    ],
    'FunctionName' => 'my-function',
    'MemorySize' => 256,
]);

Result syntax:

[
    'CodeSha256' => 'PFn4S+er27qk+UuZSTKEQfNKG/XNn7QJs90mJgq6oH8=',
    'CodeSize' => 308,
    'Description' => '',
    'DurableConfig' => [
        'ExecutionTimeout' => 3600,
        'RetentionPeriodInDays' => 45,
    ],
    'FunctionArn' => 'arn:aws:lambda:us-east-2:123456789012:function:my-function',
    'FunctionName' => 'my-function',
    'Handler' => 'index.handler',
    'LastModified' => '2019-08-14T22:26:11.234+0000',
    'MemorySize' => 256,
    'RevisionId' => '873282ed-xmpl-4dc8-a069-d0c647e470c6',
    'Role' => 'arn:aws:iam::123456789012:role/lambda-role',
    'Runtime' => 'nodejs12.x',
    'Timeout' => 3,
    'TracingConfig' => [
        'Mode' => 'PassThrough',
    ],
    'Version' => '$LATEST',
]

UpdateFunctionEventInvokeConfig

$result = $client->updateFunctionEventInvokeConfig([/* ... */]);
$promise = $client->updateFunctionEventInvokeConfigAsync([/* ... */]);

Updates the configuration for asynchronous invocation for a function, version, or alias.

To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

Parameter Syntax

$result = $client->updateFunctionEventInvokeConfig([
    'DestinationConfig' => [
        'OnFailure' => [
            'Destination' => '<string>',
        ],
        'OnSuccess' => [
            'Destination' => '<string>',
        ],
    ],
    'FunctionName' => '<string>', // REQUIRED
    'MaximumEventAgeInSeconds' => <integer>,
    'MaximumRetryAttempts' => <integer>,
    'Qualifier' => '<string>',
]);

Parameter Details

Members
DestinationConfig
Type: DestinationConfig structure

A destination for events after they have been sent to a function for processing.

Destinations

  • Function - The Amazon Resource Name (ARN) of a Lambda function.

  • Queue - The ARN of a standard SQS queue.

  • Bucket - The ARN of an Amazon S3 bucket.

  • Topic - The ARN of a standard SNS topic.

  • Event Bus - The ARN of an Amazon EventBridge event bus.

S3 buckets are supported only for on-failure destinations. To retain records of successful invocations, use another destination type.

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.

MaximumEventAgeInSeconds
Type: int

The maximum age of a request that Lambda sends to a function for processing.

MaximumRetryAttempts
Type: int

The maximum number of times to retry when the function returns an error.

Qualifier
Type: string

A version number or alias name.

Result Syntax

[
    'DestinationConfig' => [
        'OnFailure' => [
            'Destination' => '<string>',
        ],
        'OnSuccess' => [
            'Destination' => '<string>',
        ],
    ],
    'FunctionArn' => '<string>',
    'LastModified' => <DateTime>,
    'MaximumEventAgeInSeconds' => <integer>,
    'MaximumRetryAttempts' => <integer>,
]

Result Details

Members
DestinationConfig
Type: DestinationConfig structure

A destination for events after they have been sent to a function for processing.

Destinations

  • Function - The Amazon Resource Name (ARN) of a Lambda function.

  • Queue - The ARN of a standard SQS queue.

  • Bucket - The ARN of an Amazon S3 bucket.

  • Topic - The ARN of a standard SNS topic.

  • Event Bus - The ARN of an Amazon EventBridge event bus.

S3 buckets are supported only for on-failure destinations. To retain records of successful invocations, use another destination type.

FunctionArn
Type: string

The Amazon Resource Name (ARN) of the function.

LastModified
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time that the configuration was last updated.

MaximumEventAgeInSeconds
Type: int

The maximum age of a request that Lambda sends to a function for processing.

MaximumRetryAttempts
Type: int

The maximum number of times to retry when the function returns an error.

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 update an asynchronous invocation configuration

The following example adds an on-failure destination to the existing asynchronous invocation configuration for a function named my-function.

$result = $client->updateFunctionEventInvokeConfig([
    'DestinationConfig' => [
        'OnFailure' => [
            'Destination' => 'arn:aws:sqs:us-east-2:123456789012:destination',
        ],
    ],
    'FunctionName' => 'my-function',
]);

Result syntax:

[
    'DestinationConfig' => [
        'OnFailure' => [
            'Destination' => 'arn:aws:sqs:us-east-2:123456789012:destination',
        ],
        'OnSuccess' => [
        ],
    ],
    'FunctionArn' => 'arn:aws:lambda:us-east-2:123456789012:function:my-function:$LATEST',
    'LastModified' => ,
    'MaximumEventAgeInSeconds' => 3600,
    'MaximumRetryAttempts' => 0,
]

UpdateFunctionUrlConfig

$result = $client->updateFunctionUrlConfig([/* ... */]);
$promise = $client->updateFunctionUrlConfigAsync([/* ... */]);

Updates the configuration for a Lambda function URL.

Parameter Syntax

$result = $client->updateFunctionUrlConfig([
    'AuthType' => 'NONE|AWS_IAM',
    'Cors' => [
        'AllowCredentials' => true || false,
        'AllowHeaders' => ['<string>', ...],
        'AllowMethods' => ['<string>', ...],
        'AllowOrigins' => ['<string>', ...],
        'ExposeHeaders' => ['<string>', ...],
        'MaxAge' => <integer>,
    ],
    'FunctionName' => '<string>', // REQUIRED
    'InvokeMode' => 'BUFFERED|RESPONSE_STREAM',
    'Qualifier' => '<string>',
]);

Parameter Details

Members
AuthType
Type: string

The type of authentication that your function URL uses. Set to AWS_IAM if you want to restrict access to authenticated users only. Set to NONE if you want to bypass IAM authentication to create a public endpoint. For more information, see Control access to Lambda function URLs.

Cors
Type: Cors structure

The cross-origin resource sharing (CORS) settings for your function URL.

FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.

  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN123456789012: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.

InvokeMode
Type: string

Use one of the following options:

  • BUFFERED – This is the default option. Lambda invokes your function using the Invoke API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB.

  • RESPONSE_STREAM – Your function streams payload results as they become available. Lambda invokes your function using the InvokeWithResponseStream API operation. The maximum response payload size is 200 MB.

Qualifier
Type: string

The alias name.

Result Syntax

[
    'AuthType' => 'NONE|AWS_IAM',
    'Cors' => [
        'AllowCredentials' => true || false,
        'AllowHeaders' => ['<string>', ...],
        'AllowMethods' => ['<string>', ...],
        'AllowOrigins' => ['<string>', ...],
        'ExposeHeaders' => ['<string>', ...],
        'MaxAge' => <integer>,
    ],
    'CreationTime' => '<string>',
    'FunctionArn' => '<string>',
    'FunctionUrl' => '<string>',
    'InvokeMode' => 'BUFFERED|RESPONSE_STREAM',
    'LastModifiedTime' => '<string>',
]

Result Details

Members
AuthType
Required: Yes
Type: string

The type of authentication that your function URL uses. Set to AWS_IAM if you want to restrict access to authenticated users only. Set to NONE if you want to bypass IAM authentication to create a public endpoint. For more information, see Control access to Lambda function URLs.

Cors
Type: Cors structure

The cross-origin resource sharing (CORS) settings for your function URL.

CreationTime
Required: Yes
Type: string

When the function URL was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

FunctionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of your function.

FunctionUrl
Required: Yes
Type: string

The HTTP URL endpoint for your function.

InvokeMode
Type: string

Use one of the following options:

  • BUFFERED – This is the default option. Lambda invokes your function using the Invoke API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB.

  • RESPONSE_STREAM – Your function streams payload results as they become available. Lambda invokes your function using the InvokeWithResponseStream API operation. The maximum response payload size is 200 MB.

LastModifiedTime
Required: Yes
Type: string

When the function URL configuration was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

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.

Shapes

AccountLimit

Description

Limits that are related to concurrency and storage. All file and storage sizes are in bytes.

Members
CodeSizeUnzipped
Type: long (int|float)

The maximum size of a function's deployment package and layers when they're extracted.

CodeSizeZipped
Type: long (int|float)

The maximum size of a deployment package when it's uploaded directly to Lambda. Use Amazon S3 for larger files.

ConcurrentExecutions
Type: int

The maximum number of simultaneous function executions.

TotalCodeSize
Type: long (int|float)

The amount of storage space that you can use for all deployment packages and layer archives.

UnreservedConcurrentExecutions
Type: int

The maximum number of simultaneous function executions, minus the capacity that's reserved for individual functions with PutFunctionConcurrency.

AccountUsage

Description

The number of functions and amount of storage in use.

Members
FunctionCount
Type: long (int|float)

The number of Lambda functions.

TotalCodeSize
Type: long (int|float)

The amount of storage space, in bytes, that's being used by deployment packages and layer archives.

AliasRoutingConfiguration

Description

The traffic-shifting configuration of a Lambda function alias.

Members
AdditionalVersionWeights
Type: Associative array of custom strings keys (AdditionalVersion) to doubles

The second version, and the percentage of traffic that's routed to it.

AllowedPublishers

Description

List of signing profiles that can sign a code package.

Members
SigningProfileVersionArns
Required: Yes
Type: Array of strings

The Amazon Resource Name (ARN) for each of the signing profiles. A signing profile defines a trusted user who can sign a code package.

AmazonManagedKafkaEventSourceConfig

Description

Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.

Members
ConsumerGroupId
Type: string

The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.

SchemaRegistryConfig
Type: KafkaSchemaRegistryConfig structure

Specific configuration settings for a Kafka schema registry.

CallbackDetails

Description

Contains details about a callback operation in a durable execution, including the callback token and timeout configuration.

Members
CallbackId
Type: string

The callback ID. Callback IDs are generated by the DurableContext when a durable function calls ctx.waitForCallback.

Error
Type: ErrorObject structure

An error object that contains details about the failure.

Result
Type: string

The response payload from the callback operation as a string.

CallbackFailedDetails

Description

Contains details about a failed callback operation, including error information and the reason for failure.

Members
Error
Required: Yes
Type: EventError structure

An error object that contains details about the failure.

CallbackOptions

Description

Configuration options for callback operations in durable executions, including timeout settings and retry behavior.

Members
HeartbeatTimeoutSeconds
Type: int

The heartbeat timeout for the callback operation, in seconds. If not specified or set to 0, heartbeat timeout is disabled.

TimeoutSeconds
Type: int

The timeout for the callback operation in seconds. If not specified or set to 0, the callback has no timeout.

CallbackStartedDetails

Description

Contains details about a callback operation that has started, including timing information and callback metadata.

Members
CallbackId
Required: Yes
Type: string

The callback ID. Callback IDs are generated by the DurableContext when a durable function calls ctx.waitForCallback.

HeartbeatTimeout
Type: int

The heartbeat timeout value, in seconds.

Timeout
Type: int

The timeout value, in seconds.

CallbackSucceededDetails

Description

Contains details about a successfully completed callback operation, including the result data and completion timestamp.

Members
Result
Required: Yes
Type: EventResult structure

The response payload from the successful operation.

CallbackTimedOutDetails

Description

Contains details about a callback operation that timed out, including timeout duration and any partial results.

Members
Error
Required: Yes
Type: EventError structure

Details about the callback timeout.

CallbackTimeoutException

Description

The callback ID token has either expired or the callback associated with the token has already been closed.

Members
Message
Type: string
Type
Type: string

The exception type.

CapacityProvider

Description

A capacity provider manages compute resources for Lambda functions.

Members
CapacityProviderArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the capacity provider.

CapacityProviderScalingConfig

The scaling configuration for the capacity provider.

InstanceRequirements
Type: InstanceRequirements structure

The instance requirements for compute resources managed by the capacity provider.

KmsKeyArn
Type: string

The ARN of the KMS key used to encrypt the capacity provider's resources.

LastModified
Type: string

The date and time when the capacity provider was last modified.

PermissionsConfig
Required: Yes
Type: CapacityProviderPermissionsConfig structure

The permissions configuration for the capacity provider.

State
Required: Yes
Type: string

The current state of the capacity provider.

VpcConfig
Required: Yes
Type: CapacityProviderVpcConfig structure

The VPC configuration for the capacity provider.

CapacityProviderConfig

Description

Configuration for the capacity provider that manages compute resources for Lambda functions.

Members
LambdaManagedInstancesCapacityProviderConfig
Required: Yes
Type: LambdaManagedInstancesCapacityProviderConfig structure

Configuration for Lambda-managed instances used by the capacity provider.

CapacityProviderLimitExceededException

Description

The maximum number of capacity providers for your account has been exceeded. For more information, see Lambda quotas

Members
Type
Type: string

The exception type.

message
Type: string

CapacityProviderPermissionsConfig

Description

Configuration that specifies the permissions required for the capacity provider to manage compute resources.

Members
CapacityProviderOperatorRoleArn
Required: Yes
Type: string

The ARN of the IAM role that the capacity provider uses to manage compute instances and other Amazon Web Services resources.

CapacityProviderScalingConfig

Description

Configuration that defines how the capacity provider scales compute instances based on demand and policies.

Members
MaxVCpuCount
Type: int

The maximum number of vCPUs that the capacity provider can provision across all compute instances.

ScalingMode
Type: string

The scaling mode that determines how the capacity provider responds to changes in demand.

ScalingPolicies
Type: Array of TargetTrackingScalingPolicy structures

A list of scaling policies that define how the capacity provider scales compute instances based on metrics and thresholds.

CapacityProviderVpcConfig

Description

VPC configuration that specifies the network settings for compute instances managed by the capacity provider.

Members
SecurityGroupIds
Required: Yes
Type: Array of strings

A list of security group IDs that control network access for compute instances managed by the capacity provider.

SubnetIds
Required: Yes
Type: Array of strings

A list of subnet IDs where the capacity provider launches compute instances.

ChainedInvokeDetails

Description

Contains details about a chained function invocation in a durable execution, including the target function and invocation parameters.

Members
Error
Type: ErrorObject structure

Details about the chained invocation failure.

Result
Type: string

The response payload from the chained invocation.

ChainedInvokeFailedDetails

Description

Contains details about a failed chained function invocation, including error information and failure reason.

Members
Error
Required: Yes
Type: EventError structure

Details about the chained invocation failure.

ChainedInvokeOptions

Description

Configuration options for chained function invocations in durable executions, including retry settings and timeout configuration.

Members
FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function to invoke.

TenantId
Type: string

The tenant identifier for the chained invocation.

ChainedInvokeStartedDetails

Description

Contains details about a chained function invocation that has started execution, including start time and execution context.

Members
DurableExecutionArn
Type: string

The Amazon Resource Name (ARN) that identifies the durable execution.

ExecutedVersion
Type: string

The version of the function that was executed.

FunctionName
Required: Yes
Type: string

The name or ARN of the Lambda function being invoked.

Input
Type: EventInput structure

The JSON input payload provided to the chained invocation.

TenantId
Type: string

The tenant identifier for the chained invocation.

ChainedInvokeStoppedDetails

Description

Details about a chained invocation that was stopped.

Members
Error
Required: Yes
Type: EventError structure

Details about why the chained invocation stopped.

ChainedInvokeSucceededDetails

Description

Details about a chained invocation that succeeded.

Members
Result
Required: Yes
Type: EventResult structure

The response payload from the successful operation.

ChainedInvokeTimedOutDetails

Description

Details about a chained invocation that timed out.

Members
Error
Required: Yes
Type: EventError structure

Details about the chained invocation timeout.

CheckpointUpdatedExecutionState

Description

Contains operations that have been updated since the last checkpoint, such as completed asynchronous work like timers or callbacks.

Members
NextMarker
Type: string

Indicates that more results are available. Use this value in a subsequent call to retrieve the next page of results.

Operations
Type: Array of Operation structures

A list of operations that have been updated since the last checkpoint.

CodeSigningConfig

Description

Details about a Code signing configuration.

Members
AllowedPublishers
Required: Yes
Type: AllowedPublishers structure

List of allowed publishers.

CodeSigningConfigArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the Code signing configuration.

CodeSigningConfigId
Required: Yes
Type: string

Unique identifer for the Code signing configuration.

CodeSigningPolicies
Required: Yes
Type: CodeSigningPolicies structure

The code signing policy controls the validation failure action for signature mismatch or expiry.

Description
Type: string

Code signing configuration description.

LastModified
Required: Yes
Type: string

The date and time that the Code signing configuration was last modified, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

CodeSigningConfigNotFoundException

Description

The specified code signing configuration does not exist.

Members
Message
Type: string
Type
Type: string

CodeSigningPolicies

Description

Code signing configuration policies specify the validation failure action for signature mismatch or expiry.

Members
UntrustedArtifactOnDeployment
Type: string

Code signing configuration policy for deployment validation failure. If you set the policy to Enforce, Lambda blocks the deployment request if signature validation checks fail. If you set the policy to Warn, Lambda allows the deployment and issues a new Amazon CloudWatch metric (SignatureValidationErrors) and also stores the warning in the CloudTrail log.

Default value: Warn

CodeStorageExceededException

Description

Your Amazon Web Services account has exceeded its maximum total code size. For more information, see Lambda quotas.

Members
Type
Type: string

The exception type.

message
Type: string

CodeVerificationFailedException

Description

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.

Members
Message
Type: string
Type
Type: string

ContextDetails

Description

Details about a durable execution context.

Members
Error
Type: ErrorObject structure

Details about the context failure.

ReplayChildren
Type: boolean

Whether the state data of child operations of this completed context should be included in the invoke payload and GetDurableExecutionState response.

Result
Type: string

The response payload from the context.

ContextFailedDetails

Description

Details about a context that failed.

Members
Error
Required: Yes
Type: EventError structure

Details about the context failure.

ContextOptions

Description

Configuration options for a durable execution context.

Members
ReplayChildren
Type: boolean

Whether the state data of children of the completed context should be included in the invoke payload and GetDurableExecutionState response.

ContextStartedDetails

Description

Details about a context that has started.

Members

ContextSucceededDetails

Description

Details about a context that succeeded.

Members
Result
Required: Yes
Type: EventResult structure

The JSON response payload from the successful context.

Cors

Description

The cross-origin resource sharing (CORS) settings for your Lambda function URL. Use CORS to grant access to your function URL from any origin. You can also use CORS to control access for specific HTTP headers and methods in requests to your function URL.

Members
AllowCredentials
Type: boolean

Whether to allow cookies or other credentials in requests to your function URL. The default is false.

AllowHeaders
Type: Array of strings

The HTTP headers that origins can include in requests to your function URL. For example: Date, Keep-Alive, X-Custom-Header.

AllowMethods
Type: Array of strings

The HTTP methods that are allowed when calling your function URL. For example: GET, POST, DELETE, or the wildcard character (*).

AllowOrigins
Type: Array of strings

The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example: https://www.example.com, http://localhost:60905.

Alternatively, you can grant access to all origins using the wildcard character (*).

ExposeHeaders
Type: Array of strings

The HTTP headers in your function response that you want to expose to origins that call your function URL. For example: Date, Keep-Alive, X-Custom-Header.

MaxAge
Type: int

The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default, this is set to 0, which means that the browser doesn't cache results.

DeadLetterConfig

Description

The dead-letter queue for failed asynchronous invocations.

Members
TargetArn
Type: string

The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.

DestinationConfig

Description

A configuration object that specifies the destination of an event after Lambda processes it. For more information, see Adding a destination.

Members
OnFailure
Type: OnFailure structure

The destination configuration for failed invocations.

OnSuccess
Type: OnSuccess structure

The destination configuration for successful invocations. Not supported in CreateEventSourceMapping or UpdateEventSourceMapping.

DocumentDBEventSourceConfig

Description

Specific configuration settings for a DocumentDB event source.

Members
CollectionName
Type: string

The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections.

DatabaseName
Type: string

The name of the database to consume within the DocumentDB cluster.

FullDocument
Type: string

Determines what DocumentDB sends to your event stream during document update operations. If set to UpdateLookup, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes.

DurableConfig

Description

Configuration settings for durable functions, including execution timeout and retention period for execution history.

Members
ExecutionTimeout
Type: int

The maximum time (in seconds) that a durable execution can run before timing out. This timeout applies to the entire durable execution, not individual function invocations.

RetentionPeriodInDays
Type: int

The number of days to retain execution history after a durable execution completes. After this period, execution history is no longer available through the GetDurableExecutionHistory API.

DurableExecutionAlreadyStartedException

Description

The durable execution with the specified name has already been started. Each durable execution name must be unique within the function. Use a different name or check the status of the existing execution.

Members
Message
Type: string
Type
Type: string

The exception type.

EC2AccessDeniedException

Description

Need additional permissions to configure VPC settings.

Members
Message
Type: string
Type
Type: string

EC2ThrottledException

Description

Amazon EC2 throttled Lambda during Lambda function initialization using the execution role provided for the function.

Members
Message
Type: string
Type
Type: string

EC2UnexpectedException

Description

Lambda received an unexpected Amazon EC2 client exception while setting up for the Lambda function.

Members
EC2ErrorCode
Type: string
Message
Type: string
Type
Type: string

EFSIOException

Description

An error occurred when reading from or writing to a connected file system.

Members
Message
Type: string
Type
Type: string

EFSMountConnectivityException

Description

The Lambda function couldn't make a network connection to the configured file system.

Members
Message
Type: string
Type
Type: string

EFSMountFailureException

Description

The Lambda function couldn't mount the configured file system due to a permission or configuration issue.

Members
Message
Type: string
Type
Type: string

EFSMountTimeoutException

Description

The Lambda function made a network connection to the configured file system, but the mount operation timed out.

Members
Message
Type: string
Type
Type: string

ENILimitReachedException

Description

Lambda couldn't create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached. For more information, see Lambda quotas.

Members
Message
Type: string
Type
Type: string

Environment

Description

A function's environment variable settings. You can use environment variables to adjust your function's behavior without updating code. An environment variable is a pair of strings that are stored in a function's version-specific configuration.

Members
Variables
Type: Associative array of custom strings keys (EnvironmentVariableName) to strings

Environment variable key-value pairs. For more information, see Using Lambda environment variables.

EnvironmentError

Description

Error messages for environment variables that couldn't be applied.

Members
ErrorCode
Type: string

The error code.

Message
Type: string

The error message.

EnvironmentResponse

Description

The results of an operation to update or read environment variables. If the operation succeeds, the response contains the environment variables. If it fails, the response contains details about the error.

Members
Error
Type: EnvironmentError structure

Error messages for environment variables that couldn't be applied.

Variables
Type: Associative array of custom strings keys (EnvironmentVariableName) to strings

Environment variable key-value pairs. Omitted from CloudTrail logs.

EphemeralStorage

Description

The size of the function's /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).

Members
Size
Required: Yes
Type: int

The size of the function's /tmp directory.

ErrorObject

Description

An object that contains error information.

Members
ErrorData
Type: string

Machine-readable error data.

ErrorMessage
Type: string

A human-readable error message.

ErrorType
Type: string

The error type.

StackTrace
Type: Array of strings

Stack trace information for the error.

Event

Description

An event that occurred during the execution of a durable function.

Members
CallbackFailedDetails
Type: CallbackFailedDetails structure

Contains details about a failed callback operation, including error information and the reason for failure.

CallbackStartedDetails
Type: CallbackStartedDetails structure

Contains details about a callback operation that has started, including timing information and callback metadata.

CallbackSucceededDetails
Type: CallbackSucceededDetails structure

Contains details about a successfully completed callback operation, including the result data and completion timestamp.

CallbackTimedOutDetails
Type: CallbackTimedOutDetails structure

Contains details about a callback operation that timed out, including timeout duration and any partial results.

ChainedInvokeFailedDetails
Type: ChainedInvokeFailedDetails structure

Contains details about a failed chained function invocation, including error information and failure reason.

ChainedInvokeStartedDetails
Type: ChainedInvokeStartedDetails structure

Contains details about a chained function invocation that has started execution, including start time and execution context.

ChainedInvokeStoppedDetails
Type: ChainedInvokeStoppedDetails structure

Details about a chained invocation that was stopped.

ChainedInvokeSucceededDetails

Details about a chained invocation that succeeded.

ChainedInvokeTimedOutDetails

Details about a chained invocation that timed out.

ContextFailedDetails
Type: ContextFailedDetails structure

Details about a context that failed.

ContextStartedDetails
Type: ContextStartedDetails structure

Details about a context that started.

ContextSucceededDetails
Type: ContextSucceededDetails structure

Details about a context that succeeded.

EventId
Type: int

The unique identifier for this event. Event IDs increment sequentially.

EventTimestamp
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time when this event occurred, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

EventType
Type: string

The type of event that occurred.

ExecutionFailedDetails
Type: ExecutionFailedDetails structure

Details about an execution that failed.

ExecutionStartedDetails
Type: ExecutionStartedDetails structure

Details about an execution that started.

ExecutionStoppedDetails
Type: ExecutionStoppedDetails structure

Details about an execution that was stopped.

ExecutionSucceededDetails
Type: ExecutionSucceededDetails structure

Details about an execution that succeeded.

ExecutionTimedOutDetails
Type: ExecutionTimedOutDetails structure

Details about an execution that timed out.

Id
Type: string

The unique identifier for this operation.

InvocationCompletedDetails
Type: InvocationCompletedDetails structure

Details about a function invocation that completed.

Name
Type: string

The customer-provided name for this operation.

ParentId
Type: string

The unique identifier of the parent operation, if this operation is running within a child context.

StepFailedDetails
Type: StepFailedDetails structure

Details about a step that failed.

StepStartedDetails
Type: StepStartedDetails structure

Details about a step that started.

StepSucceededDetails
Type: StepSucceededDetails structure

Details about a step that succeeded.

SubType
Type: string

The subtype of the event, providing additional categorization.

WaitCancelledDetails
Type: WaitCancelledDetails structure

Details about a wait operation that was cancelled.

WaitStartedDetails
Type: WaitStartedDetails structure

Details about a wait operation that started.

WaitSucceededDetails
Type: WaitSucceededDetails structure

Details about a wait operation that succeeded.

EventError

Description

Error information for an event.

Members
Payload
Type: ErrorObject structure

The error payload.

Truncated
Type: boolean

Indicates if the error payload was truncated due to size limits.

EventInput

Description

Input information for an event.

Members
Payload
Type: string

The input payload.

Truncated
Type: boolean

Indicates if the error payload was truncated due to size limits.

EventResult

Description

Result information for an event.

Members
Payload
Type: string

The result payload.

Truncated
Type: boolean

Indicates if the error payload was truncated due to size limits.

EventSourceMappingMetricsConfig

Description

The metrics configuration for your event source. Use this configuration object to define which metrics you want your event source mapping to produce.

Members
Metrics
Type: Array of strings

The metrics you want your event source mapping to produce. Include EventCount to receive event source mapping metrics related to the number of events processed by your event source mapping. For more information about these metrics, see Event source mapping metrics.

Execution

Description

Information about a durable execution.

Members
DurableExecutionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the durable execution, if this execution is a durable execution.

DurableExecutionName
Required: Yes
Type: string

The unique name of the durable execution, if one was provided when the execution was started.

EndTimestamp
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time when the durable execution ended, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

FunctionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the Lambda function.

StartTimestamp
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time when the durable execution started, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

Status
Required: Yes
Type: string

The current status of the durable execution.

ExecutionDetails

Description

Details about a durable execution.

Members
InputPayload
Type: string

The original input payload provided for the durable execution.

ExecutionFailedDetails

Description

Details about a failed durable execution.

Members
Error
Required: Yes
Type: EventError structure

Details about the execution failure.

ExecutionStartedDetails

Description

Details about a durable execution that started.

Members
ExecutionTimeout
Required: Yes
Type: int

The maximum amount of time that the durable execution is allowed to run, in seconds.

Input
Required: Yes
Type: EventInput structure

The input payload provided for the durable execution.

ExecutionStoppedDetails

Description

Details about a durable execution that stopped.

Members
Error
Required: Yes
Type: EventError structure

Details about why the execution stopped.

ExecutionSucceededDetails

Description

Details about a durable execution that succeeded.

Members
Result
Required: Yes
Type: EventResult structure

The response payload from the successful operation.

ExecutionTimedOutDetails

Description

Details about a durable execution that timed out.

Members
Error
Type: EventError structure

Details about the execution timeout.

FileSystemConfig

Description

Details about the connection between a Lambda function and an Amazon EFS file system.

Members
Arn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the Amazon EFS access point that provides access to the file system.

LocalMountPath
Required: Yes
Type: string

The path where the function can access the file system, starting with /mnt/.

Filter

Description

A structure within a FilterCriteria object that defines an event filtering pattern.

Members
Pattern
Type: string

A filter pattern. For more information on the syntax of a filter pattern, see Filter rule syntax.

FilterCriteria

Description

An object that contains the filters for an event source.

Members
Filters
Type: Array of Filter structures

A list of filters.

FilterCriteriaError

Description

An object that contains details about an error related to filter criteria encryption.

Members
ErrorCode
Type: string

The KMS exception that resulted from filter criteria encryption or decryption.

Message
Type: string

The error message.

FunctionCode

Description

The code for the Lambda function. You can either specify an object in Amazon S3, upload a .zip file archive deployment package directly, or specify the URI of a container image.

Members
ImageUri
Type: string

URI of a container image in the Amazon ECR registry.

S3Bucket
Type: string

An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account.

S3Key
Type: string

The Amazon S3 key of the deployment package.

S3ObjectVersion
Type: string

For versioned objects, the version of the deployment package object to use.

SourceKMSKeyArn
Type: string

The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's .zip deployment package. If you don't provide a customer managed key, Lambda uses an Amazon Web Services owned key.

ZipFile
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you.

FunctionCodeLocation

Description

Details about a function's deployment package.

Members
ImageUri
Type: string

URI of a container image in the Amazon ECR registry.

Location
Type: string

A presigned URL that you can use to download the deployment package.

RepositoryType
Type: string

The service that's hosting the file.

ResolvedImageUri
Type: string

The resolved URI for the image.

SourceKMSKeyArn
Type: string

The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's .zip deployment package. If you don't provide a customer managed key, Lambda uses an Amazon Web Services owned key.

FunctionScalingConfig

Description

Configuration that defines the scaling behavior for a Lambda Managed Instances function, including the minimum and maximum number of execution environments that can be provisioned.

Members
MaxExecutionEnvironments
Type: int

The maximum number of execution environments that can be provisioned for the function.

MinExecutionEnvironments
Type: int

The minimum number of execution environments to maintain for the function.

FunctionUrlConfig

Description

Details about a Lambda function URL.

Members
AuthType
Required: Yes
Type: string

The type of authentication that your function URL uses. Set to AWS_IAM if you want to restrict access to authenticated users only. Set to NONE if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs.

Cors
Type: Cors structure

The cross-origin resource sharing (CORS) settings for your function URL.

CreationTime
Required: Yes
Type: string

When the function URL was created, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

FunctionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of your function.

FunctionUrl
Required: Yes
Type: string

The HTTP URL endpoint for your function.

InvokeMode
Type: string

Use one of the following options:

  • BUFFERED – This is the default option. Lambda invokes your function using the Invoke API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB.

  • RESPONSE_STREAM – Your function streams payload results as they become available. Lambda invokes your function using the InvokeWithResponseStream API operation. The maximum response payload size is 200 MB.

LastModifiedTime
Required: Yes
Type: string

When the function URL configuration was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

FunctionVersionsByCapacityProviderListItem

Description

Information about a function version that uses a specific capacity provider, including its ARN and current state.

Members
FunctionArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the function version.

State
Required: Yes
Type: string

The current state of the function version.

FunctionVersionsPerCapacityProviderLimitExceededException

Description

The maximum number of function versions that can be associated with a single capacity provider has been exceeded. For more information, see Lambda quotas.

Members
Type
Type: string

The exception type.

message
Type: string

ImageConfig

Description

Configuration values that override the container image Dockerfile settings. For more information, see Container image settings.

Members
Command
Type: Array of strings

Specifies parameters that you want to pass in with ENTRYPOINT.

EntryPoint
Type: Array of strings

Specifies the entry point to their application, which is typically the location of the runtime executable.

WorkingDirectory
Type: string

Specifies the working directory.

ImageConfigError

Description

Error response to GetFunctionConfiguration.

Members
ErrorCode
Type: string

Error code.

Message
Type: string

Error message.

ImageConfigResponse

Description

Response to a GetFunctionConfiguration request.

Members
Error
Type: ImageConfigError structure

Error response to GetFunctionConfiguration.

ImageConfig
Type: ImageConfig structure

Configuration values that override the container image Dockerfile.

InstanceRequirements

Description

Specifications that define the characteristics and constraints for compute instances used by the capacity provider.

Members
AllowedInstanceTypes
Type: Array of strings

A list of EC2 instance types that the capacity provider is allowed to use. If not specified, all compatible instance types are allowed.

Architectures
Type: Array of strings

A list of supported CPU architectures for compute instances. Valid values include x86_64 and arm64.

ExcludedInstanceTypes
Type: Array of strings

A list of EC2 instance types that the capacity provider should not use, even if they meet other requirements.

InvalidCodeSignatureException

Description

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.

Members
Message
Type: string
Type
Type: string

InvalidParameterValueException

Description

One of the parameters in the request is not valid.

Members
Type
Type: string

The exception type.

message
Type: string

The exception message.

InvalidRequestContentException

Description

The request body could not be parsed as JSON, or a request header is invalid. For example, the 'x-amzn-RequestId' header is not a valid UUID string.

Members
Type
Type: string

The exception type.

message
Type: string

The exception message.

InvalidRuntimeException

Description

The runtime or runtime version specified is not supported.

Members
Message
Type: string
Type
Type: string

InvalidSecurityGroupIDException

Description

The security group ID provided in the Lambda function VPC configuration is not valid.

Members
Message
Type: string
Type
Type: string

InvalidSubnetIDException

Description

The subnet ID provided in the Lambda function VPC configuration is not valid.

Members
Message
Type: string
Type
Type: string

InvalidZipFileException

Description

Lambda could not unzip the deployment package.

Members
Message
Type: string
Type
Type: string

InvocationCompletedDetails

Description

Details about a function invocation that completed.

Members
EndTimestamp
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time when the invocation ended, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

Error
Type: EventError structure

Details about the invocation failure.

RequestId
Required: Yes
Type: string

The request ID for the invocation.

StartTimestamp
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time when the invocation started, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

InvokeResponseStreamUpdate

Description

A chunk of the streamed response payload.

Members
Payload
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

Data returned by your Lambda function.

InvokeWithResponseStreamCompleteEvent

Description

A response confirming that the event stream is complete.

Members
ErrorCode
Type: string

An error code.

ErrorDetails
Type: string

The details of any returned error.

LogResult
Type: string

The last 4 KB of the execution log, which is base64-encoded.

InvokeWithResponseStreamResponseEvent

Description

An object that includes a chunk of the response payload. When the stream has ended, Lambda includes a InvokeComplete object.

Members
InvokeComplete

An object that's returned when the stream has ended and all the payload chunks have been returned.

PayloadChunk
Type: InvokeResponseStreamUpdate structure

A chunk of the streamed response payload.

KMSAccessDeniedException

Description

Lambda couldn't decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.

Members
Message
Type: string
Type
Type: string

KMSDisabledException

Description

Lambda couldn't decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.

Members
Message
Type: string
Type
Type: string

KMSInvalidStateException

Description

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.

Members
Message
Type: string
Type
Type: string

KMSNotFoundException

Description

Lambda couldn't decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.

Members
Message
Type: string
Type
Type: string

KafkaSchemaRegistryAccessConfig

Description

Specific access configuration settings that tell Lambda how to authenticate with your schema registry.

If you're working with an Glue schema registry, don't provide authentication details in this object. Instead, ensure that your execution role has the required permissions for Lambda to access your cluster.

If you're working with a Confluent schema registry, choose the authentication method in the Type field, and provide the Secrets Manager secret ARN in the URI field.

Members
Type
Type: string

The type of authentication Lambda uses to access your schema registry.

URI
Type: string

The URI of the secret (Secrets Manager secret ARN) to authenticate with your schema registry.

KafkaSchemaRegistryConfig

Description

Specific configuration settings for a Kafka schema registry.

Members
AccessConfigs
Type: Array of KafkaSchemaRegistryAccessConfig structures

An array of access configuration objects that tell Lambda how to authenticate with your schema registry.

EventRecordFormat
Type: string

The record format that Lambda delivers to your function after schema validation.

  • Choose JSON to have Lambda deliver the record to your function as a standard JSON object.

  • Choose SOURCE to have Lambda deliver the record to your function in its original source format. Lambda removes all schema metadata, such as the schema ID, before sending the record to your function.

SchemaRegistryURI
Type: string

The URI for your schema registry. The correct URI format depends on the type of schema registry you're using.

  • For Glue schema registries, use the ARN of the registry.

  • For Confluent schema registries, use the URL of the registry.

SchemaValidationConfigs
Type: Array of KafkaSchemaValidationConfig structures

An array of schema validation configuration objects, which tell Lambda the message attributes you want to validate and filter using your schema registry.

KafkaSchemaValidationConfig

Description

Specific schema validation configuration settings that tell Lambda the message attributes you want to validate and filter using your schema registry.

Members
Attribute
Type: string

The attributes you want your schema registry to validate and filter for. If you selected JSON as the EventRecordFormat, Lambda also deserializes the selected message attributes.

LambdaManagedInstancesCapacityProviderConfig

Description

Configuration for Lambda-managed instances used by the capacity provider.

Members
CapacityProviderArn
Required: Yes
Type: string

The Amazon Resource Name (ARN) of the capacity provider.

ExecutionEnvironmentMemoryGiBPerVCpu
Type: double

The amount of memory in GiB allocated per vCPU for execution environments.

PerExecutionEnvironmentMaxConcurrency
Type: int

The maximum number of concurrent execution environments that can run on each compute instance.

Layer

Description
Members
Arn
Type: string

The Amazon Resource Name (ARN) of the function layer.

CodeSize
Type: long (int|float)

The size of the layer archive in bytes.

SigningJobArn
Type: string

The Amazon Resource Name (ARN) of a signing job.

SigningProfileVersionArn
Type: string

The Amazon Resource Name (ARN) for a signing profile version.

LayerVersionContentInput

Description

A ZIP archive that contains the contents of an Lambda layer. You can specify either an Amazon S3 location, or upload a layer archive directly.

Members
S3Bucket
Type: string

The Amazon S3 bucket of the layer archive.

S3Key
Type: string

The Amazon S3 key of the layer archive.

S3ObjectVersion
Type: string

For versioned objects, the version of the layer archive object to use.

ZipFile
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

The base64-encoded contents of the layer archive. Amazon Web Services SDK and Amazon Web Services CLI clients handle the encoding for you.

LayerVersionContentOutput

Description

Details about a version of an Lambda layer.

Members
CodeSha256
Type: string

The SHA-256 hash of the layer archive.

CodeSize
Type: long (int|float)

The size of the layer archive in bytes.

Location
Type: string

A link to the layer archive in Amazon S3 that is valid for 10 minutes.

SigningJobArn
Type: string

The Amazon Resource Name (ARN) of a signing job.

SigningProfileVersionArn
Type: string

The Amazon Resource Name (ARN) for a signing profile version.

LayerVersionsListItem

Description

Details about a version of an Lambda layer.

Members
CompatibleArchitectures
Type: Array of strings

A list of compatible instruction set architectures.

CompatibleRuntimes
Type: Array of strings

The layer's compatible runtimes.

The following list includes deprecated runtimes. For more information, see Runtime use after deprecation.

For a list of all currently supported runtimes, see Supported runtimes.

CreatedDate
Type: string

The date that the version was created, in ISO 8601 format. For example, 2018-11-27T15:10:45.123+0000.

Description
Type: string

The description of the version.

LayerVersionArn
Type: string

The ARN of the layer version.

LicenseInfo
Type: string

The layer's open-source license.

Version
Type: long (int|float)

The version number.

LayersListItem

Description

Details about an Lambda layer.

Members
LatestMatchingVersion
Type: LayerVersionsListItem structure

The newest version of the layer.

LayerArn
Type: string

The Amazon Resource Name (ARN) of the function layer.

LayerName
Type: string

The name of the layer.

LoggingConfig

Description

The function's Amazon CloudWatch Logs configuration settings.

Members
ApplicationLogLevel
Type: string

Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where TRACE is the highest level and FATAL is the lowest.

LogFormat
Type: string

The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.

LogGroup
Type: string

The name of the Amazon CloudWatch log group the function sends logs to. By default, Lambda functions send logs to a default log group named /aws/lambda/<function name>. To use a different log group, enter an existing log group or enter a new log group name.

SystemLogLevel
Type: string

Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where DEBUG is the highest level and WARN is the lowest.

NoPublishedVersionException

Description

The function has no published versions available.

Members
Message
Type: string
Type
Type: string

The exception type.

OnFailure

Description

A destination for events that failed processing. For more information, see Adding a destination.

Members
Destination
Type: string

The Amazon Resource Name (ARN) of the destination resource.

To retain records of failed invocations from Kinesis, DynamoDB, self-managed Apache Kafka, or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, Amazon S3 bucket, or Kafka topic as the destination.

Amazon SNS destinations have a message size limit of 256 KB. If the combined size of the function request and response payload exceeds the limit, Lambda will drop the payload when sending OnFailure event to the destination. For details on this behavior, refer to Retaining records of asynchronous invocations.

To retain records of failed invocations from Kinesis, DynamoDB, self-managed Kafka or Amazon MSK, you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination.

OnSuccess

Description

A destination for events that were processed successfully.

To retain records of successful asynchronous invocations, you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function, or Amazon EventBridge event bus as the destination.

OnSuccess is not supported in CreateEventSourceMapping or UpdateEventSourceMapping requests.

Members
Destination
Type: string

The Amazon Resource Name (ARN) of the destination resource.

Amazon SNS destinations have a message size limit of 256 KB. If the combined size of the function request and response payload exceeds the limit, Lambda will drop the payload when sending OnFailure event to the destination. For details on this behavior, refer to Retaining records of asynchronous invocations.

Operation

Description

Information about an operation within a durable execution.

Members
CallbackDetails
Type: CallbackDetails structure

Contains details about a callback operation in a durable execution, including the callback token and timeout configuration.

ChainedInvokeDetails
Type: ChainedInvokeDetails structure

Contains details about a chained function invocation in a durable execution, including the target function and invocation parameters.

ContextDetails
Type: ContextDetails structure

Details about the context, if this operation represents a context.

EndTimestamp
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time when the operation ended, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

ExecutionDetails
Type: ExecutionDetails structure

Details about the execution, if this operation represents an execution.

Id
Required: Yes
Type: string

The unique identifier for this operation.

Name
Type: string

The customer-provided name for this operation.

ParentId
Type: string

The unique identifier of the parent operation, if this operation is running within a child context.

StartTimestamp
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time when the operation started, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

Status
Required: Yes
Type: string

The current status of the operation.

StepDetails
Type: StepDetails structure

Details about the step, if this operation represents a step.

SubType
Type: string

The subtype of the operation, providing additional categorization.

Type
Required: Yes
Type: string

The type of operation.

WaitDetails
Type: WaitDetails structure

Details about the wait operation, if this operation represents a wait.

OperationUpdate

Description

An update to be applied to an operation during checkpointing.

Members
Action
Required: Yes
Type: string

The action to take on the operation.

CallbackOptions
Type: CallbackOptions structure

Configuration options for callback operations in durable executions, including timeout settings and retry behavior.

ChainedInvokeOptions
Type: ChainedInvokeOptions structure

Configuration options for chained function invocations in durable executions, including retry settings and timeout configuration.

ContextOptions
Type: ContextOptions structure

Options for context operations.

Error
Type: ErrorObject structure

The error information for failed operations.

Id
Required: Yes
Type: string

The unique identifier for this operation.

Name
Type: string

The customer-provided name for this operation.

ParentId
Type: string

The unique identifier of the parent operation, if this operation is running within a child context.

Payload
Type: string

The payload for successful operations.

StepOptions
Type: StepOptions structure

Options for step operations.

SubType
Type: string

The subtype of the operation, providing additional categorization.

Type
Required: Yes
Type: string

The type of operation to update.

WaitOptions
Type: WaitOptions structure

Options for wait operations.

PolicyLengthExceededException

Description

The permissions policy for the resource is too large. For more information, see Lambda quotas.

Members
Type
Type: string
message
Type: string

PreconditionFailedException

Description

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

  • For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

  • For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

Members
Type
Type: string

The exception type.

message
Type: string

The exception message.

ProvisionedConcurrencyConfigListItem

Description

Details about the provisioned concurrency configuration for a function alias or version.

Members
AllocatedProvisionedConcurrentExecutions
Type: int

The amount of provisioned concurrency allocated. When a weighted alias is used during linear and canary deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function versions.

AvailableProvisionedConcurrentExecutions
Type: int

The amount of provisioned concurrency available.

FunctionArn
Type: string

The Amazon Resource Name (ARN) of the alias or version.

LastModified
Type: string

The date and time that a user last updated the configuration, in ISO 8601 format.

RequestedProvisionedConcurrentExecutions
Type: int

The amount of provisioned concurrency requested.

Status
Type: string

The status of the allocation process.

StatusReason
Type: string

For failed allocations, the reason that provisioned concurrency could not be allocated.

ProvisionedConcurrencyConfigNotFoundException

Description

The specified configuration does not exist.

Members
Type
Type: string
message
Type: string

ProvisionedPollerConfig

Description

The provisioned mode configuration for the event source. Use Provisioned Mode to customize the minimum and maximum number of event pollers for your event source.

Members
MaximumPollers
Type: int

The maximum number of event pollers this event source can scale up to. For Amazon SQS events source mappings, default is 200, and minimum value allowed is 2. For Amazon MSK and self-managed Apache Kafka event source mappings, default is 200, and minimum value allowed is 1.

MinimumPollers
Type: int

The minimum number of event pollers this event source can scale down to. For Amazon SQS events source mappings, default is 2, and minimum 2 required. For Amazon MSK and self-managed Apache Kafka event source mappings, default is 1.

PollerGroupName
Type: string

(Amazon MSK and self-managed Apache Kafka) The name of the provisioned poller group. Use this option to group multiple ESMs within the event source's VPC to share Event Poller Unit (EPU) capacity. You can use this option to optimize Provisioned mode costs for your ESMs. You can group up to 100 ESMs per poller group and aggregate maximum pollers across all ESMs in a group cannot exceed 2000.

RecursiveInvocationException

Description

Lambda has detected your function being invoked in a recursive loop with other Amazon Web Services resources and stopped your function's invocation.

Members
Message
Type: string

The exception message.

Type
Type: string

The exception type.

RequestTooLargeException

Description

The request payload exceeded the Invoke request body JSON input quota. For more information, see Lambda quotas.

Members
Type
Type: string
message
Type: string

ResourceConflictException

Description

The resource already exists, or another operation is in progress.

Members
Type
Type: string

The exception type.

message
Type: string

The exception message.

ResourceInUseException

Description

The operation conflicts with the resource's availability. For example, you tried to update an event source mapping in the CREATING state, or you tried to delete an event source mapping currently UPDATING.

Members
Message
Type: string
Type
Type: string

ResourceNotFoundException

Description

The resource specified in the request does not exist.

Members
Message
Type: string
Type
Type: string

ResourceNotReadyException

Description

The function is inactive and its VPC connection is no longer available. Wait for the VPC connection to reestablish and try again.

Members
Type
Type: string

The exception type.

message
Type: string

The exception message.

RetryDetails

Description

Information about retry attempts for an operation.

Members
CurrentAttempt
Type: int

The current attempt number for this operation.

NextAttemptDelaySeconds
Type: int

The delay before the next retry attempt, in seconds.

RuntimeVersionConfig

Description

The ARN of the runtime and any errors that occured.

Members
Error
Type: RuntimeVersionError structure

Error response when Lambda is unable to retrieve the runtime version for a function.

RuntimeVersionArn
Type: string

The ARN of the runtime version you want the function to use.

RuntimeVersionError

Description

Any error returned when the runtime version information for the function could not be retrieved.

Members
ErrorCode
Type: string

The error code.

Message
Type: string

The error message.

ScalingConfig

Description

(Amazon SQS only) The scaling configuration for the event source. To remove the configuration, pass an empty value.

Members
MaximumConcurrency
Type: int

Limits the number of concurrent instances that the Amazon SQS event source can invoke.

SelfManagedEventSource

Description

The self-managed Apache Kafka cluster for your event source.

Members
Endpoints
Type: Associative array of custom strings keys (EndPointType) to stringss

The list of bootstrap servers for your Kafka brokers in the following format: "KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"].

SelfManagedKafkaEventSourceConfig

Description

Specific configuration settings for a self-managed Apache Kafka event source.

Members
ConsumerGroupId
Type: string

The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. For more information, see Customizable consumer group ID.

SchemaRegistryConfig
Type: KafkaSchemaRegistryConfig structure

Specific configuration settings for a Kafka schema registry.

SerializedRequestEntityTooLargeException

Description

The request payload exceeded the maximum allowed size for serialized request entities.

Members
Type
Type: string

The error type.

message
Type: string

ServiceException

Description

The Lambda service encountered an internal error.

Members
Message
Type: string
Type
Type: string

SnapStart

Description

The function's Lambda SnapStart setting. Set ApplyOn to PublishedVersions to create a snapshot of the initialized execution environment when you publish a function version.

Members
ApplyOn
Type: string

Set to PublishedVersions to create a snapshot of the initialized execution environment when you publish a function version.

SnapStartException

Description

The afterRestore() runtime hook encountered an error. For more information, check the Amazon CloudWatch logs.

Members
Message
Type: string
Type
Type: string

SnapStartNotReadyException

Description

Lambda is initializing your function. You can invoke the function when the function state becomes Active.

Members
Message
Type: string
Type
Type: string

SnapStartResponse

Description

The function's SnapStart setting.

Members
ApplyOn
Type: string

When set to PublishedVersions, Lambda creates a snapshot of the execution environment when you publish a function version.

OptimizationStatus
Type: string

When you provide a qualified Amazon Resource Name (ARN), this response element indicates whether SnapStart is activated for the specified function version.

SnapStartTimeoutException

Description

Lambda couldn't restore the snapshot within the timeout limit.

Members
Message
Type: string
Type
Type: string

SourceAccessConfiguration

Description

To secure and define access to your event source, you can specify the authentication protocol, VPC components, or virtual host.

Members
Type
Type: string

The type of authentication protocol, VPC components, or virtual host for your event source. For example: "Type":"SASL_SCRAM_512_AUTH".

  • BASIC_AUTH – (Amazon MQ) The Secrets Manager secret that stores your broker credentials.

  • BASIC_AUTH – (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers.

  • VPC_SUBNET – (Self-managed Apache Kafka) The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your self-managed Apache Kafka cluster.

  • VPC_SECURITY_GROUP – (Self-managed Apache Kafka) The VPC security group used to manage access to your self-managed Apache Kafka brokers.

  • SASL_SCRAM_256_AUTH – (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your self-managed Apache Kafka brokers.

  • SASL_SCRAM_512_AUTH – (Amazon MSK, Self-managed Apache Kafka) The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your self-managed Apache Kafka brokers.

  • VIRTUAL_HOST –- (RabbitMQ) The name of the virtual host in your RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. This property cannot be specified in an UpdateEventSourceMapping API call.

  • CLIENT_CERTIFICATE_TLS_AUTH – (Amazon MSK, self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private key password (optional) used for mutual TLS authentication of your MSK/Apache Kafka brokers.

  • SERVER_ROOT_CA_CERTIFICATE – (Self-managed Apache Kafka) The Secrets Manager ARN of your secret key containing the root CA certificate (X.509 PEM) used for TLS encryption of your Apache Kafka brokers.

URI
Type: string

The value for your chosen configuration in Type. For example: "URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName".

StepDetails

Description

Details about a step operation.

Members
Attempt
Type: int

The current attempt number for this step.

Error
Type: ErrorObject structure

Details about the step failure.

NextAttemptTimestamp
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time when the next attempt is scheduled, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD). Only populated when the step is in a pending state.

Result
Type: string

The JSON response payload from the step operation.

StepFailedDetails

Description

Details about a step that failed.

Members
Error
Required: Yes
Type: EventError structure

Details about the step failure.

RetryDetails
Required: Yes
Type: RetryDetails structure

Information about retry attempts for this step operation.

StepOptions

Description

Configuration options for a step operation.

Members
NextAttemptDelaySeconds
Type: int

The delay in seconds before the next retry attempt.

StepStartedDetails

Description

Details about a step that has started.

Members

StepSucceededDetails

Description

Details about a step that succeeded.

Members
Result
Required: Yes
Type: EventResult structure

The response payload from the successful operation.

RetryDetails
Required: Yes
Type: RetryDetails structure

Information about retry attempts for this step operation.

SubnetIPAddressLimitReachedException

Description

Lambda couldn't set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses.

Members
Message
Type: string
Type
Type: string

TagsError

Description

An object that contains details about an error related to retrieving tags.

Members
ErrorCode
Required: Yes
Type: string

The error code.

Message
Required: Yes
Type: string

The error message.

TargetTrackingScalingPolicy

Description

A scaling policy for the capacity provider that automatically adjusts capacity to maintain a target value for a specific metric.

Members
PredefinedMetricType
Required: Yes
Type: string

The predefined metric type to track for scaling decisions.

TargetValue
Required: Yes
Type: double

The target value for the metric that the scaling policy attempts to maintain through scaling actions.

TenancyConfig

Description

Specifies the tenant isolation mode configuration for a Lambda function. This allows you to configure specific tenant isolation strategies for your function invocations. Tenant isolation configuration cannot be modified after function creation.

Members
TenantIsolationMode
Required: Yes
Type: string

Tenant isolation mode allows for invocation to be sent to a corresponding execution environment dedicated to a specific tenant ID.

TooManyRequestsException

Description

The request throughput limit was exceeded. For more information, see Lambda quotas.

Members
Reason
Type: string
Type
Type: string
message
Type: string
retryAfterSeconds
Type: string

The number of seconds the caller should wait before retrying.

TraceHeader

Description

Contains trace headers for the Lambda durable execution.

Members
XAmznTraceId
Type: string

The X-Ray trace header associated with the durable execution.

TracingConfig

Description

The function's X-Ray tracing configuration. To sample and record incoming requests, set Mode to Active.

Members
Mode
Type: string

The tracing mode.

TracingConfigResponse

Description

The function's X-Ray tracing configuration.

Members
Mode
Type: string

The tracing mode.

UnsupportedMediaTypeException

Description

The content type of the Invoke request body is not JSON.

Members
Type
Type: string
message
Type: string

VpcConfig

Description

The VPC security groups and subnets that are attached to a Lambda function. For more information, see Configuring a Lambda function to access resources in a VPC.

Members
Ipv6AllowedForDualStack
Type: boolean

Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.

SecurityGroupIds
Type: Array of strings

A list of VPC security group IDs.

SubnetIds
Type: Array of strings

A list of VPC subnet IDs.

VpcConfigResponse

Description

The VPC security groups and subnets that are attached to a Lambda function.

Members
Ipv6AllowedForDualStack
Type: boolean

Allows outbound IPv6 traffic on VPC functions that are connected to dual-stack subnets.

SecurityGroupIds
Type: Array of strings

A list of VPC security group IDs.

SubnetIds
Type: Array of strings

A list of VPC subnet IDs.

VpcId
Type: string

The ID of the VPC.

WaitCancelledDetails

Description

Details about a wait operation that was cancelled.

Members
Error
Type: EventError structure

Details about why the wait operation was cancelled.

WaitDetails

Description

Details about a wait operation.

Members
ScheduledEndTimestamp
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time when the wait operation is scheduled to complete, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

WaitOptions

Description

Specifies how long to pause the durable execution.

Members
WaitSeconds
Type: int

The duration to wait, in seconds.

WaitStartedDetails

Description

Details about a wait operation that has started.

Members
Duration
Required: Yes
Type: int

The duration to wait, in seconds.

ScheduledEndTimestamp
Required: Yes
Type: timestamp (string|DateTime or anything parsable by strtotime)

The date and time when the wait operation is scheduled to complete, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).

WaitSucceededDetails

Description

Details about a wait operation that succeeded.

Members
Duration
Type: int

The wait duration, in seconds.