AWS Lambda 2015-03-31
- Client: Aws\Lambda\LambdaClient
- Service ID: lambda
- Version: 2015-03-31
This page describes the parameters and results for the operations of the AWS Lambda (2015-03-31), and shows how to use the Aws\Lambda\LambdaClient object to call the described operations. This documentation is specific to the 2015-03-31 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName')
, where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */)
.
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */)
.
- AddLayerVersionPermission ( array $params = [] )
Adds permissions to the resource-based policy of a version of an AWS Lambda layer.
- AddPermission ( array $params = [] )
Grants an AWS service or another account permission to use a function.
- CreateAlias ( array $params = [] )
Creates an alias for a Lambda function version.
- CreateCodeSigningConfig ( array $params = [] )
Creates a code signing configuration.
- CreateEventSourceMapping ( array $params = [] )
Creates a mapping between an event source and an AWS Lambda function.
- CreateFunction ( array $params = [] )
Creates a Lambda function.
- DeleteAlias ( array $params = [] )
Deletes a Lambda function alias.
- 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.
- DeleteLayerVersion ( array $params = [] )
Deletes a version of an AWS 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 AWS Region.
- GetAlias ( array $params = [] )
Returns details about a Lambda function alias.
- GetCodeSigningConfig ( array $params = [] )
Returns information about the specified code signing configuration.
- 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.
- GetLayerVersion ( array $params = [] )
Returns information about a version of an AWS 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 AWS 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 AWS 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.
- Invoke ( array $params = [] )
Invokes a Lambda function.
- InvokeAsync ( array $params = [] )
For asynchronous function invocation, use Invoke.
- ListAliases ( array $params = [] )
Returns a list of aliases for a Lambda function.
- ListCodeSigningConfigs ( array $params = [] )
Returns a list of code signing configurations.
- ListEventSourceMappings ( array $params = [] )
Lists event source mappings.
- ListFunctionEventInvokeConfigs ( array $params = [] )
Retrieves a list of configurations for asynchronous invocation for a function.
- 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 AWS Lambda layer.
- ListLayers ( array $params = [] )
Lists AWS 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's tags.
- ListVersionsByFunction ( array $params = [] )
Returns a list of versions, with the version-specific configuration of each.
- PublishLayerVersion ( array $params = [] )
Creates an AWS 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.
- PutProvisionedConcurrencyConfig ( array $params = [] )
Adds a provisioned concurrency configuration to a function's alias or version.
- RemoveLayerVersionPermission ( array $params = [] )
Removes a statement from the permissions policy for a version of an AWS Lambda layer.
- RemovePermission ( array $params = [] )
Revokes function-use permission from an AWS service or another account.
- TagResource ( array $params = [] )
Adds tags to a function.
- UntagResource ( array $params = [] )
Removes tags from a function.
- UpdateAlias ( array $params = [] )
Updates the configuration of a Lambda function alias.
- 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.
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:
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 |
---|---|---|---|
FunctionExists | GetFunction | 1 | 20 |
FunctionActive | GetFunctionConfiguration | 5 | 60 |
FunctionUpdated | GetFunctionConfiguration | 5 | 60 |
Operations
AddLayerVersionPermission
$result = $client->addLayerVersionPermission
([/* ... */]); $promise = $client->addLayerVersionPermissionAsync
([/* ... */]);
Adds permissions to the resource-based policy of a version of an AWS Lambda layer. Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all AWS accounts, or all accounts in an organization.
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 permission to all AWS accounts. - 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
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
The resource already exists, or another operation is in progress.
-
The request throughput limit was exceeded.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
PolicyLengthExceededException:
The permissions policy for the resource is too large. Learn more
-
The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the
GetFunction
or theGetAlias
API 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 an AWS service or another account 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.
To grant permission to another account, specify the account ID as the Principal
. For AWS services, the principal is a domain-style identifier defined by the service, like s3.amazonaws.com
or sns.amazonaws.com
. For AWS 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 action adds a statement to a resource-based permissions policy for the function. For more information about function policies, see Lambda Function Policies.
Parameter Syntax
$result = $client->addPermission([ 'Action' => '<string>', // REQUIRED 'EventSourceToken' => '<string>', 'FunctionName' => '<string>', // REQUIRED 'Principal' => '<string>', // REQUIRED '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
orlambda:GetFunction
. - EventSourceToken
-
- Type: string
For Alexa Smart Home functions, a token that must be supplied by the invoker.
- FunctionName
-
- Required: Yes
- Type: string
The name 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.
- Principal
-
- Required: Yes
- Type: string
The AWS service or account that invokes the function. If you specify a service, use
SourceArn
orSourceAccount
to limit who can invoke the function through that service. - Qualifier
-
- Type: string
Specify a version or alias to add permissions to a published version of the function.
- RevisionId
-
- Type: string
Only update the policy 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 S3, the ID of the account that owns the resource. Use this together with
SourceArn
to ensure that the resource is owned by the specified account. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account. - SourceArn
-
- Type: string
For AWS services, the ARN of the AWS resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic.
- StatementId
-
- Required: Yes
- Type: string
A statement identifier that differentiates the statement from others in the same policy.
Result Syntax
[ 'Statement' => '<string>', ]
Result Details
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
The resource already exists, or another operation is in progress.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
PolicyLengthExceededException:
The permissions policy for the resource is too large. Learn more
-
The request throughput limit was exceeded.
-
The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the
GetFunction
or theGetAlias
API 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"}', ]
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 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
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
The resource already exists, or another operation is in progress.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
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', ]
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>', ]);
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.
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
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
CreateEventSourceMapping
$result = $client->createEventSourceMapping
([/* ... */]); $promise = $client->createEventSourceMappingAsync
([/* ... */]);
Creates a mapping between an event source and an AWS Lambda function. Lambda reads items from the event source and triggers the function.
For details about each event source type, see the following topics.
The following error handling options are only available for stream sources (DynamoDB and Kinesis):
-
BisectBatchOnFunctionError
- If the function returns an error, split the batch in two and retry. -
DestinationConfig
- Send discarded records to an Amazon SQS queue or Amazon SNS topic. -
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. -
ParallelizationFactor
- Process multiple batches from each shard concurrently.
Parameter Syntax
$result = $client->createEventSourceMapping([ 'BatchSize' => <integer>, 'BisectBatchOnFunctionError' => true || false, 'DestinationConfig' => [ 'OnFailure' => [ 'Destination' => '<string>', ], 'OnSuccess' => [ 'Destination' => '<string>', ], ], 'Enabled' => true || false, 'EventSourceArn' => '<string>', 'FunctionName' => '<string>', // REQUIRED 'FunctionResponseTypes' => ['<string>', ...], 'MaximumBatchingWindowInSeconds' => <integer>, 'MaximumRecordAgeInSeconds' => <integer>, 'MaximumRetryAttempts' => <integer>, 'ParallelizationFactor' => <integer>, 'Queues' => ['<string>', ...], 'SelfManagedEventSource' => [ 'Endpoints' => [ '<EndPointType>' => ['<string>', ...], // ... ], ], 'SourceAccessConfigurations' => [ [ 'Type' => 'BASIC_AUTH|VPC_SUBNET|VPC_SECURITY_GROUP|SASL_SCRAM_512_AUTH|SASL_SCRAM_256_AUTH', 'URI' => '<string>', ], // ... ], 'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP', 'StartingPositionTimestamp' => <integer || string || DateTime>, 'Topics' => ['<string>', ...], 'TumblingWindowInSeconds' => <integer>, ]);
Parameter Details
Members
- BatchSize
-
- Type: int
The maximum number of items to retrieve in a single batch.
-
Amazon Kinesis - Default 100. Max 10,000.
-
Amazon DynamoDB Streams - Default 100. Max 1,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.
- BisectBatchOnFunctionError
-
- Type: boolean
(Streams) If the function returns an error, split the batch in two and retry.
- DestinationConfig
-
- Type: DestinationConfig structure
(Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
- Enabled
-
- Type: boolean
If true, the event source mapping is active. Set to false to pause polling and invocation.
- 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.
- FunctionName
-
- Required: Yes
- Type: string
The name of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Version or Alias ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.
- FunctionResponseTypes
-
- Type: Array of strings
(Streams) A list of current response type enums applied to the event source mapping.
- MaximumBatchingWindowInSeconds
-
- Type: int
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds.
- MaximumRecordAgeInSeconds
-
- Type: int
(Streams) Discard records older than the specified age. The default value is infinite (-1).
- MaximumRetryAttempts
-
- Type: int
(Streams) Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records will be retried until the record expires.
- ParallelizationFactor
-
- Type: int
(Streams) The number of batches to process from each shard concurrently.
- Queues
-
- Type: Array of strings
(MQ) The name of the Amazon MQ broker destination queue to consume.
- SelfManagedEventSource
-
- Type: SelfManagedEventSource structure
The Self-Managed Apache Kafka cluster to send records.
- SourceAccessConfigurations
-
- Type: Array of SourceAccessConfiguration structures
An array of the authentication protocol, or the VPC components to secure your event source.
- StartingPosition
-
- Type: string
The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources.
AT_TIMESTAMP
is only supported for Amazon Kinesis streams. - StartingPositionTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
With
StartingPosition
set toAT_TIMESTAMP
, the time from which to start reading. - Topics
-
- Type: Array of strings
The name of the Kafka topic.
- TumblingWindowInSeconds
-
- Type: int
(Streams) The duration of a processing window in seconds. The range is between 1 second up to 15 minutes.
Result Syntax
[ 'BatchSize' => <integer>, 'BisectBatchOnFunctionError' => true || false, 'DestinationConfig' => [ 'OnFailure' => [ 'Destination' => '<string>', ], 'OnSuccess' => [ 'Destination' => '<string>', ], ], 'EventSourceArn' => '<string>', 'FunctionArn' => '<string>', 'FunctionResponseTypes' => ['<string>', ...], 'LastModified' => <DateTime>, 'LastProcessingResult' => '<string>', 'MaximumBatchingWindowInSeconds' => <integer>, 'MaximumRecordAgeInSeconds' => <integer>, 'MaximumRetryAttempts' => <integer>, 'ParallelizationFactor' => <integer>, 'Queues' => ['<string>', ...], 'SelfManagedEventSource' => [ 'Endpoints' => [ '<EndPointType>' => ['<string>', ...], // ... ], ], 'SourceAccessConfigurations' => [ [ 'Type' => 'BASIC_AUTH|VPC_SUBNET|VPC_SECURITY_GROUP|SASL_SCRAM_512_AUTH|SASL_SCRAM_256_AUTH', 'URI' => '<string>', ], // ... ], 'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP', 'StartingPositionTimestamp' => <DateTime>, 'State' => '<string>', 'StateTransitionReason' => '<string>', 'Topics' => ['<string>', ...], 'TumblingWindowInSeconds' => <integer>, 'UUID' => '<string>', ]
Result Details
Members
- BatchSize
-
- Type: int
The maximum number of items to retrieve in a single batch.
- BisectBatchOnFunctionError
-
- Type: boolean
(Streams) If the function returns an error, split the batch in two and retry. The default value is false.
- DestinationConfig
-
- Type: DestinationConfig structure
(Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
- EventSourceArn
-
- Type: string
The Amazon Resource Name (ARN) of the event source.
- FunctionArn
-
- Type: string
The ARN of the Lambda function.
- FunctionResponseTypes
-
- Type: Array of strings
(Streams) A list of current response type enums applied to the event source mapping.
- LastModified
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The date that the event source mapping was last updated, or its state changed.
- LastProcessingResult
-
- Type: string
The result of the last AWS Lambda invocation of your Lambda function.
- MaximumBatchingWindowInSeconds
-
- Type: int
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds. The default value is zero.
- MaximumRecordAgeInSeconds
-
- Type: int
(Streams) 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
-
- Type: int
(Streams) 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.
- ParallelizationFactor
-
- Type: int
(Streams) The number of batches to process from each shard concurrently. The default value is 1.
- Queues
-
- Type: Array of strings
(MQ) The name of the Amazon MQ broker destination queue to consume.
- SelfManagedEventSource
-
- Type: SelfManagedEventSource structure
The Self-Managed Apache Kafka cluster for your event source.
- SourceAccessConfigurations
-
- Type: Array of SourceAccessConfiguration structures
An array of the authentication protocol, or the VPC components to secure your event source.
- StartingPosition
-
- Type: string
The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources.
AT_TIMESTAMP
is only supported for Amazon Kinesis streams. - StartingPositionTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
With
StartingPosition
set toAT_TIMESTAMP
, the time from which to start reading. - State
-
- Type: string
The state of the event source mapping. It can be one of the following:
Creating
,Enabling
,Enabled
,Disabling
,Disabled
,Updating
, orDeleting
. - StateTransitionReason
-
- Type: string
Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service.
- Topics
-
- Type: Array of strings
The name of the Kafka topic.
- TumblingWindowInSeconds
-
- Type: int
(Streams) The duration of a processing window in seconds. The range is between 1 second up to 15 minutes.
- UUID
-
- Type: string
The identifier of the event source mapping.
Errors
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource already exists, or another operation is in progress.
-
The request throughput limit was exceeded.
-
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 AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X-Ray for request tracing.
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 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 set of signing profiles, which define the trusted publishers for this function.
If another account or an AWS service invokes your function, use AddPermission to grant permission by creating a resource-based 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 AWS services, create an event source mapping (CreateEventSourceMapping), or configure a function trigger in the other service. For more information, see Invoking Functions.
Parameter Syntax
$result = $client->createFunction([ 'Code' => [ // REQUIRED 'ImageUri' => '<string>', 'S3Bucket' => '<string>', 'S3Key' => '<string>', 'S3ObjectVersion' => '<string>', 'ZipFile' => <string || resource || Psr\Http\Message\StreamInterface>, ], 'CodeSigningConfigArn' => '<string>', 'DeadLetterConfig' => [ 'TargetArn' => '<string>', ], 'Description' => '<string>', 'Environment' => [ 'Variables' => ['<string>', ...], ], 'FileSystemConfigs' => [ [ 'Arn' => '<string>', // REQUIRED 'LocalMountPath' => '<string>', // REQUIRED ], // ... ], 'FunctionName' => '<string>', // REQUIRED 'Handler' => '<string>', 'ImageConfig' => [ 'Command' => ['<string>', ...], 'EntryPoint' => ['<string>', ...], 'WorkingDirectory' => '<string>', ], 'KMSKeyArn' => '<string>', 'Layers' => ['<string>', ...], 'MemorySize' => <integer>, 'PackageType' => 'Zip|Image', 'Publish' => true || false, 'Role' => '<string>', // REQUIRED 'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2', 'Tags' => ['<string>', ...], 'Timeout' => <integer>, 'TracingConfig' => [ 'Mode' => 'Active|PassThrough', ], 'VpcConfig' => [ 'SecurityGroupIds' => ['<string>', ...], 'SubnetIds' => ['<string>', ...], ], ]);
Parameter Details
Members
- 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.
- Environment
-
- Type: Environment structure
Environment variables that are accessible from function code during execution.
- FileSystemConfigs
-
- Type: Array of FileSystemConfig structures
Connection settings for an Amazon EFS file system.
- FunctionName
-
- Required: Yes
- Type: string
The name of the Lambda function.
Name formats
-
Function name -
my-function
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN -
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- Handler
-
- Type: string
The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Programming Model.
- ImageConfig
-
- Type: ImageConfig structure
Configuration values that override the container image Dockerfile.
- KMSKeyArn
-
- Type: string
The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service 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.
- MemorySize
-
- Type: int
The amount of memory available to the function at runtime. Increasing the function's 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 setZip
for ZIP archive. - Publish
-
- Type: boolean
Set to true to publish the first version of the function during creation.
- 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.
- Tags
-
- Type: Associative array of custom strings keys (TagKey) to strings
A list of tags to apply to the function.
- Timeout
-
- Type: int
The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.
- TracingConfig
-
- Type: TracingConfig structure
Set
Mode
toActive
to sample and trace a subset of incoming requests with AWS X-Ray. - VpcConfig
-
- Type: VpcConfig structure
For network connectivity to AWS 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 only access resources and the internet through that VPC. For more information, see VPC Settings.
Result Syntax
[ 'CodeSha256' => '<string>', 'CodeSize' => <integer>, 'DeadLetterConfig' => [ 'TargetArn' => '<string>', ], 'Description' => '<string>', 'Environment' => [ 'Error' => [ 'ErrorCode' => '<string>', 'Message' => '<string>', ], 'Variables' => ['<string>', ...], ], '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', 'Layers' => [ [ 'Arn' => '<string>', 'CodeSize' => <integer>, 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', ], // ... ], 'MasterArn' => '<string>', 'MemorySize' => <integer>, 'PackageType' => 'Zip|Image', 'RevisionId' => '<string>', 'Role' => '<string>', 'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2', 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', 'State' => 'Pending|Active|Inactive|Failed', 'StateReason' => '<string>', 'StateReasonCode' => 'Idle|Creating|Restoring|EniLimitExceeded|InsufficientRolePermissions|InvalidConfiguration|InternalError|SubnetOutOfIPAddresses|InvalidSubnet|InvalidSecurityGroup|ImageDeleted|ImageAccessDenied|InvalidImage', 'Timeout' => <integer>, 'TracingConfig' => [ 'Mode' => 'Active|PassThrough', ], 'Version' => '<string>', 'VpcConfig' => [ 'SecurityGroupIds' => ['<string>', ...], 'SubnetIds' => ['<string>', ...], 'VpcId' => '<string>', ], ]
Result Details
Members
- 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.
- DeadLetterConfig
-
- Type: DeadLetterConfig structure
The function's dead letter queue.
- Description
-
- Type: string
The function's description.
- Environment
-
- Type: EnvironmentResponse structure
The function's environment variables.
- 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 executing your function.
- ImageConfigResponse
-
- Type: ImageConfigResponse structure
The function's image configuration values.
- KMSKeyArn
-
- Type: string
The KMS key that's used to encrypt the function's environment variables. This key is only returned if you've configured a customer managed CMK.
- 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.
- MasterArn
-
- Type: string
For Lambda@Edge functions, the ARN of the master 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 setZip
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 runtime environment for the Lambda function.
- SigningJobArn
-
- Type: string
The ARN of the signing job.
- SigningProfileVersionArn
-
- Type: string
The ARN of the signing profile version.
- 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. - 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 AWS X-Ray tracing configuration.
- Version
-
- Type: string
The version of the Lambda function.
- VpcConfig
-
- Type: VpcConfigResponse structure
The function's networking configuration.
Errors
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource specified in the request does not exist.
-
The resource already exists, or another operation is in progress.
-
The request throughput limit was exceeded.
-
You have exceeded your maximum total code size per account. Learn more
-
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.
-
InvalidCodeSignatureException:
The code signature failed the integrity check. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN.
-
CodeSigningConfigNotFoundException:
The specified code signing configuration does not exist.
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.', '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.', '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', ]
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 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
Errors
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource already exists, or another operation is in progress.
-
The request throughput limit was exceeded.
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', ]);
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
Result Syntax
[]
Result Details
Errors
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource specified in the request does not exist.
-
The resource already exists, or another operation is in progress.
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
Result Syntax
[ 'BatchSize' => <integer>, 'BisectBatchOnFunctionError' => true || false, 'DestinationConfig' => [ 'OnFailure' => [ 'Destination' => '<string>', ], 'OnSuccess' => [ 'Destination' => '<string>', ], ], 'EventSourceArn' => '<string>', 'FunctionArn' => '<string>', 'FunctionResponseTypes' => ['<string>', ...], 'LastModified' => <DateTime>, 'LastProcessingResult' => '<string>', 'MaximumBatchingWindowInSeconds' => <integer>, 'MaximumRecordAgeInSeconds' => <integer>, 'MaximumRetryAttempts' => <integer>, 'ParallelizationFactor' => <integer>, 'Queues' => ['<string>', ...], 'SelfManagedEventSource' => [ 'Endpoints' => [ '<EndPointType>' => ['<string>', ...], // ... ], ], 'SourceAccessConfigurations' => [ [ 'Type' => 'BASIC_AUTH|VPC_SUBNET|VPC_SECURITY_GROUP|SASL_SCRAM_512_AUTH|SASL_SCRAM_256_AUTH', 'URI' => '<string>', ], // ... ], 'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP', 'StartingPositionTimestamp' => <DateTime>, 'State' => '<string>', 'StateTransitionReason' => '<string>', 'Topics' => ['<string>', ...], 'TumblingWindowInSeconds' => <integer>, 'UUID' => '<string>', ]
Result Details
Members
- BatchSize
-
- Type: int
The maximum number of items to retrieve in a single batch.
- BisectBatchOnFunctionError
-
- Type: boolean
(Streams) If the function returns an error, split the batch in two and retry. The default value is false.
- DestinationConfig
-
- Type: DestinationConfig structure
(Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
- EventSourceArn
-
- Type: string
The Amazon Resource Name (ARN) of the event source.
- FunctionArn
-
- Type: string
The ARN of the Lambda function.
- FunctionResponseTypes
-
- Type: Array of strings
(Streams) A list of current response type enums applied to the event source mapping.
- LastModified
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The date that the event source mapping was last updated, or its state changed.
- LastProcessingResult
-
- Type: string
The result of the last AWS Lambda invocation of your Lambda function.
- MaximumBatchingWindowInSeconds
-
- Type: int
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds. The default value is zero.
- MaximumRecordAgeInSeconds
-
- Type: int
(Streams) 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
-
- Type: int
(Streams) 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.
- ParallelizationFactor
-
- Type: int
(Streams) The number of batches to process from each shard concurrently. The default value is 1.
- Queues
-
- Type: Array of strings
(MQ) The name of the Amazon MQ broker destination queue to consume.
- SelfManagedEventSource
-
- Type: SelfManagedEventSource structure
The Self-Managed Apache Kafka cluster for your event source.
- SourceAccessConfigurations
-
- Type: Array of SourceAccessConfiguration structures
An array of the authentication protocol, or the VPC components to secure your event source.
- StartingPosition
-
- Type: string
The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources.
AT_TIMESTAMP
is only supported for Amazon Kinesis streams. - StartingPositionTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
With
StartingPosition
set toAT_TIMESTAMP
, the time from which to start reading. - State
-
- Type: string
The state of the event source mapping. It can be one of the following:
Creating
,Enabling
,Enabled
,Disabling
,Disabled
,Updating
, orDeleting
. - StateTransitionReason
-
- Type: string
Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service.
- Topics
-
- Type: Array of strings
The name of the Kafka topic.
- TumblingWindowInSeconds
-
- Type: int
(Streams) The duration of a processing window in seconds. The range is between 1 second up to 15 minutes.
- UUID
-
- Type: string
The identifier of the event source mapping.
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
-
The operation conflicts with the resource's availability. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state.
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.
To delete Lambda event source mappings that invoke a function, use DeleteEventSourceMapping. For AWS 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 of the Lambda function or version.
Name formats
-
Function name -
my-function
(name-only),my-function:1
(with version). -
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
Specify a version to delete. You can't delete a version that's referenced by an alias.
Result Syntax
[]
Result Details
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource already exists, or another operation is in progress.
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 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
Errors
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
CodeSigningConfigNotFoundException:
The specified code signing configuration does not exist.
-
The resource specified in the request does not exist.
-
The AWS Lambda service encountered an internal error.
-
The request throughput limit was exceeded.
-
The resource already exists, or another operation is in progress.
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 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.
Result Syntax
[]
Result Details
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource already exists, or another operation is in progress.
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 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
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
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', ]);
DeleteLayerVersion
$result = $client->deleteLayerVersion
([/* ... */]); $promise = $client->deleteLayerVersionAsync
([/* ... */]);
Deletes a version of an AWS 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
Result Syntax
[]
Result Details
Errors
-
The AWS Lambda service encountered an internal error.
-
The request throughput limit was exceeded.
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 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.
- Qualifier
-
- Required: Yes
- Type: string
The version number or alias name.
Result Syntax
[]
Result Details
Errors
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource already exists, or another operation is in progress.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
The AWS Lambda service encountered an internal error.
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 AWS 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
-
The request throughput limit was exceeded.
-
The AWS Lambda service encountered an internal error.
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 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
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
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', ]
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
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
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource specified in the request does not exist.
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
Result Syntax
[ 'BatchSize' => <integer>, 'BisectBatchOnFunctionError' => true || false, 'DestinationConfig' => [ 'OnFailure' => [ 'Destination' => '<string>', ], 'OnSuccess' => [ 'Destination' => '<string>', ], ], 'EventSourceArn' => '<string>', 'FunctionArn' => '<string>', 'FunctionResponseTypes' => ['<string>', ...], 'LastModified' => <DateTime>, 'LastProcessingResult' => '<string>', 'MaximumBatchingWindowInSeconds' => <integer>, 'MaximumRecordAgeInSeconds' => <integer>, 'MaximumRetryAttempts' => <integer>, 'ParallelizationFactor' => <integer>, 'Queues' => ['<string>', ...], 'SelfManagedEventSource' => [ 'Endpoints' => [ '<EndPointType>' => ['<string>', ...], // ... ], ], 'SourceAccessConfigurations' => [ [ 'Type' => 'BASIC_AUTH|VPC_SUBNET|VPC_SECURITY_GROUP|SASL_SCRAM_512_AUTH|SASL_SCRAM_256_AUTH', 'URI' => '<string>', ], // ... ], 'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP', 'StartingPositionTimestamp' => <DateTime>, 'State' => '<string>', 'StateTransitionReason' => '<string>', 'Topics' => ['<string>', ...], 'TumblingWindowInSeconds' => <integer>, 'UUID' => '<string>', ]
Result Details
Members
- BatchSize
-
- Type: int
The maximum number of items to retrieve in a single batch.
- BisectBatchOnFunctionError
-
- Type: boolean
(Streams) If the function returns an error, split the batch in two and retry. The default value is false.
- DestinationConfig
-
- Type: DestinationConfig structure
(Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
- EventSourceArn
-
- Type: string
The Amazon Resource Name (ARN) of the event source.
- FunctionArn
-
- Type: string
The ARN of the Lambda function.
- FunctionResponseTypes
-
- Type: Array of strings
(Streams) A list of current response type enums applied to the event source mapping.
- LastModified
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The date that the event source mapping was last updated, or its state changed.
- LastProcessingResult
-
- Type: string
The result of the last AWS Lambda invocation of your Lambda function.
- MaximumBatchingWindowInSeconds
-
- Type: int
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds. The default value is zero.
- MaximumRecordAgeInSeconds
-
- Type: int
(Streams) 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
-
- Type: int
(Streams) 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.
- ParallelizationFactor
-
- Type: int
(Streams) The number of batches to process from each shard concurrently. The default value is 1.
- Queues
-
- Type: Array of strings
(MQ) The name of the Amazon MQ broker destination queue to consume.
- SelfManagedEventSource
-
- Type: SelfManagedEventSource structure
The Self-Managed Apache Kafka cluster for your event source.
- SourceAccessConfigurations
-
- Type: Array of SourceAccessConfiguration structures
An array of the authentication protocol, or the VPC components to secure your event source.
- StartingPosition
-
- Type: string
The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources.
AT_TIMESTAMP
is only supported for Amazon Kinesis streams. - StartingPositionTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
With
StartingPosition
set toAT_TIMESTAMP
, the time from which to start reading. - State
-
- Type: string
The state of the event source mapping. It can be one of the following:
Creating
,Enabling
,Enabled
,Disabling
,Disabled
,Updating
, orDeleting
. - StateTransitionReason
-
- Type: string
Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service.
- Topics
-
- Type: Array of strings
The name of the Kafka topic.
- TumblingWindowInSeconds
-
- Type: int
(Streams) The duration of a processing window in seconds. The range is between 1 second up to 15 minutes.
- UUID
-
- Type: string
The identifier of the event source mapping.
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
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 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
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>', ], 'Concurrency' => [ 'ReservedConcurrentExecutions' => <integer>, ], 'Configuration' => [ 'CodeSha256' => '<string>', 'CodeSize' => <integer>, 'DeadLetterConfig' => [ 'TargetArn' => '<string>', ], 'Description' => '<string>', 'Environment' => [ 'Error' => [ 'ErrorCode' => '<string>', 'Message' => '<string>', ], 'Variables' => ['<string>', ...], ], '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', 'Layers' => [ [ 'Arn' => '<string>', 'CodeSize' => <integer>, 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', ], // ... ], 'MasterArn' => '<string>', 'MemorySize' => <integer>, 'PackageType' => 'Zip|Image', 'RevisionId' => '<string>', 'Role' => '<string>', 'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2', 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', 'State' => 'Pending|Active|Inactive|Failed', 'StateReason' => '<string>', 'StateReasonCode' => 'Idle|Creating|Restoring|EniLimitExceeded|InsufficientRolePermissions|InvalidConfiguration|InternalError|SubnetOutOfIPAddresses|InvalidSubnet|InvalidSecurityGroup|ImageDeleted|ImageAccessDenied|InvalidImage', 'Timeout' => <integer>, 'TracingConfig' => [ 'Mode' => 'Active|PassThrough', ], 'Version' => '<string>', 'VpcConfig' => [ 'SecurityGroupIds' => ['<string>', ...], 'SubnetIds' => ['<string>', ...], 'VpcId' => '<string>', ], ], 'Tags' => ['<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.
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
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.', '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 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 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 invalid.
-
The resource specified in the request does not exist.
-
The AWS Lambda service encountered an internal error.
-
The request throughput limit was exceeded.
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 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.
Result Syntax
[ 'ReservedConcurrentExecutions' => <integer>, ]
Result Details
Members
Errors
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
The AWS Lambda service encountered an internal error.
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 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
Specify a version or alias to get details about a published version of the function.
Result Syntax
[ 'CodeSha256' => '<string>', 'CodeSize' => <integer>, 'DeadLetterConfig' => [ 'TargetArn' => '<string>', ], 'Description' => '<string>', 'Environment' => [ 'Error' => [ 'ErrorCode' => '<string>', 'Message' => '<string>', ], 'Variables' => ['<string>', ...], ], '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', 'Layers' => [ [ 'Arn' => '<string>', 'CodeSize' => <integer>, 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', ], // ... ], 'MasterArn' => '<string>', 'MemorySize' => <integer>, 'PackageType' => 'Zip|Image', 'RevisionId' => '<string>', 'Role' => '<string>', 'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2', 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', 'State' => 'Pending|Active|Inactive|Failed', 'StateReason' => '<string>', 'StateReasonCode' => 'Idle|Creating|Restoring|EniLimitExceeded|InsufficientRolePermissions|InvalidConfiguration|InternalError|SubnetOutOfIPAddresses|InvalidSubnet|InvalidSecurityGroup|ImageDeleted|ImageAccessDenied|InvalidImage', 'Timeout' => <integer>, 'TracingConfig' => [ 'Mode' => 'Active|PassThrough', ], 'Version' => '<string>', 'VpcConfig' => [ 'SecurityGroupIds' => ['<string>', ...], 'SubnetIds' => ['<string>', ...], 'VpcId' => '<string>', ], ]
Result Details
Members
- 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.
- DeadLetterConfig
-
- Type: DeadLetterConfig structure
The function's dead letter queue.
- Description
-
- Type: string
The function's description.
- Environment
-
- Type: EnvironmentResponse structure
The function's environment variables.
- 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 executing your function.
- ImageConfigResponse
-
- Type: ImageConfigResponse structure
The function's image configuration values.
- KMSKeyArn
-
- Type: string
The KMS key that's used to encrypt the function's environment variables. This key is only returned if you've configured a customer managed CMK.
- 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.
- MasterArn
-
- Type: string
For Lambda@Edge functions, the ARN of the master 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 setZip
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 runtime environment for the Lambda function.
- SigningJobArn
-
- Type: string
The ARN of the signing job.
- SigningProfileVersionArn
-
- Type: string
The ARN of the signing profile version.
- 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. - 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 AWS X-Ray tracing configuration.
- Version
-
- Type: string
The version of the Lambda function.
- VpcConfig
-
- Type: VpcConfigResponse structure
The function's networking configuration.
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
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.', '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 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 an SQS queue.
-
Topic - The ARN of an SNS topic.
-
Event Bus - The ARN of an Amazon EventBridge event bus.
- 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
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
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, ]
GetLayerVersion
$result = $client->getLayerVersion
([/* ... */]); $promise = $client->getLayerVersionAsync
([/* ... */]);
Returns information about a version of an AWS 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
Result Syntax
[ '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
- CompatibleRuntimes
-
- Type: Array of strings
The layer's compatible 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
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
-
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 AWS 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
Result Syntax
[ '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
- CompatibleRuntimes
-
- Type: Array of strings
The layer's compatible 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
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
-
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 AWS Lambda layer. For more information, see AddLayerVersionPermission.
Parameter Syntax
$result = $client->getLayerVersionPolicy([ 'LayerName' => '<string>', // REQUIRED 'VersionNumber' => <integer>, // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'Policy' => '<string>', 'RevisionId' => '<string>', ]
Result Details
Members
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
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 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
Specify a version or alias to get the policy for that resource.
Result Syntax
[ 'Policy' => '<string>', 'RevisionId' => '<string>', ]
Result Details
Members
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
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 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.
- 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.
- 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 invalid.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
The AWS Lambda service encountered an internal error.
-
ProvisionedConcurrencyConfigNotFoundException:
The specified configuration does not exist.
Examples
Example 1: 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', ]
Example 2: 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', ]
Invoke
$result = $client->invoke
([/* ... */]); $promise = $client->invokeAsync
([/* ... */]);
Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or asynchronously. To invoke a function asynchronously, set InvocationType
to Event
.
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 Retry Behavior.
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, limit errors, or issues with your function's code and configuration. For example, Lambda returns TooManyRequestsException
if executing 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 be disconnected 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.
Parameter Syntax
$result = $client->invoke([ 'ClientContext' => '<string>', 'FunctionName' => '<string>', // REQUIRED 'InvocationType' => 'Event|RequestResponse|DryRun', 'LogType' => 'None|Tail', 'Payload' => <string || resource || Psr\Http\Message\StreamInterface>, 'Qualifier' => '<string>', ]);
Parameter Details
Members
- ClientContext
-
- Type: string
Up to 3583 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 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.
- 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 it's 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. - Payload
-
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
The JSON that you want to provide to your Lambda function as input.
- Qualifier
-
- Type: string
Specify a version or alias to invoke a published version of the function.
Result Syntax
[ 'ExecutedVersion' => '<string>', 'FunctionError' => '<string>', 'LogResult' => '<string>', 'Payload' => <string || resource || Psr\Http\Message\StreamInterface>, 'StatusCode' => <integer>, ]
Result Details
Members
- 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 theEvent
invocation type, this status code is 202. For theDryRun
invocation type, the status code is 204.
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidRequestContentException:
The request body could not be parsed as JSON.
-
The request payload exceeded the
Invoke
request body JSON input limit. For more information, see Limits. -
UnsupportedMediaTypeException:
The content type of the
Invoke
request body is not JSON. -
The request throughput limit was exceeded.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
AWS Lambda received an unexpected EC2 client exception while setting up for the Lambda function.
-
SubnetIPAddressLimitReachedException:
AWS Lambda was not able to set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses.
-
AWS Lambda was not able to create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached.
-
EFSMountConnectivityException:
The function couldn't make a network connection to the configured file system.
-
The function couldn't mount the configured file system due to a permission or configuration issue.
-
The function was able to make a network connection to the configured file system, but the mount operation timed out.
-
An error occured when reading from or writing to a connected file system.
-
AWS Lambda was throttled by Amazon EC2 during Lambda function initialization using the execution role provided for the Lambda function.
-
Need additional permissions to configure VPC settings.
-
The Subnet ID provided in the Lambda function VPC configuration is invalid.
-
InvalidSecurityGroupIDException:
The Security Group ID provided in the Lambda function VPC configuration is invalid.
-
AWS Lambda could not unzip the deployment package.
-
Lambda was unable to decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.
-
Lambda was unable to decrypt the environment variables because the KMS key used is in an invalid state for Decrypt. Check the function's KMS key settings.
-
Lambda was unable to decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.
-
Lambda was unable to decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.
-
The runtime or runtime version specified is not supported.
-
The resource already exists, or another operation is in progress.
-
The function is inactive and its VPC connection is no longer available. Wait for the VPC connection to reestablish and try again.
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([ 'FunctionName' => 'my-function', '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, ]
InvokeAsync
$result = $client->invokeAsync
([/* ... */]); $promise = $client->invokeAsyncAsync
([/* ... */]);
For asynchronous function invocation, use Invoke.
Invokes a function asynchronously.
Parameter Syntax
$result = $client->invokeAsync([ 'FunctionName' => '<string>', // REQUIRED 'InvokeArgs' => <string || resource || Psr\Http\Message\StreamInterface>, // REQUIRED ]);
Parameter Details
Members
- FunctionName
-
- Required: Yes
- Type: string
The name 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.
- 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
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidRequestContentException:
The request body could not be parsed as JSON.
-
The runtime or runtime version specified is not supported.
-
The resource already exists, or another operation is in progress.
Examples
Example 1: To invoke a Lambda function asynchronously
The following example invokes a Lambda function asynchronously
$result = $client->invokeAsync([ 'FunctionName' => 'my-function', 'InvokeArgs' => <BLOB>, ]);
Result syntax:
[ 'Status' => 202, ]
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 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
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
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', ], ], ]
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
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
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
ListEventSourceMappings
$result = $client->listEventSourceMappings
([/* ... */]); $promise = $client->listEventSourceMappingsAsync
([/* ... */]);
Lists event source mappings. Specify an EventSourceArn
to only show 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.
- FunctionName
-
- Type: string
The name of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Version or Alias ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.
- Marker
-
- Type: string
A pagination token returned by a previous call.
- MaxItems
-
- Type: int
The maximum number of event source mappings to return.
Result Syntax
[ 'EventSourceMappings' => [ [ 'BatchSize' => <integer>, 'BisectBatchOnFunctionError' => true || false, 'DestinationConfig' => [ 'OnFailure' => [ 'Destination' => '<string>', ], 'OnSuccess' => [ 'Destination' => '<string>', ], ], 'EventSourceArn' => '<string>', 'FunctionArn' => '<string>', 'FunctionResponseTypes' => ['<string>', ...], 'LastModified' => <DateTime>, 'LastProcessingResult' => '<string>', 'MaximumBatchingWindowInSeconds' => <integer>, 'MaximumRecordAgeInSeconds' => <integer>, 'MaximumRetryAttempts' => <integer>, 'ParallelizationFactor' => <integer>, 'Queues' => ['<string>', ...], 'SelfManagedEventSource' => [ 'Endpoints' => [ '<EndPointType>' => ['<string>', ...], // ... ], ], 'SourceAccessConfigurations' => [ [ 'Type' => 'BASIC_AUTH|VPC_SUBNET|VPC_SECURITY_GROUP|SASL_SCRAM_512_AUTH|SASL_SCRAM_256_AUTH', '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
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
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 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 invalid.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
The AWS Lambda service encountered an internal error.
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, ], ], ]
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. To get more information about 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 AWS Region of the master function. For example,
us-east-1
filters the list of functions to only include Lambda@Edge functions replicated from a master function in US East (N. Virginia). If specified, you must setFunctionVersion
toALL
. - MaxItems
-
- Type: int
The maximum number of functions to return.
Result Syntax
[ 'Functions' => [ [ 'CodeSha256' => '<string>', 'CodeSize' => <integer>, 'DeadLetterConfig' => [ 'TargetArn' => '<string>', ], 'Description' => '<string>', 'Environment' => [ 'Error' => [ 'ErrorCode' => '<string>', 'Message' => '<string>', ], 'Variables' => ['<string>', ...], ], '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', 'Layers' => [ [ 'Arn' => '<string>', 'CodeSize' => <integer>, 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', ], // ... ], 'MasterArn' => '<string>', 'MemorySize' => <integer>, 'PackageType' => 'Zip|Image', 'RevisionId' => '<string>', 'Role' => '<string>', 'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2', 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', 'State' => 'Pending|Active|Inactive|Failed', 'StateReason' => '<string>', 'StateReasonCode' => 'Idle|Creating|Restoring|EniLimitExceeded|InsufficientRolePermissions|InvalidConfiguration|InternalError|SubnetOutOfIPAddresses|InvalidSubnet|InvalidSecurityGroup|ImageDeleted|ImageAccessDenied|InvalidImage', 'Timeout' => <integer>, 'TracingConfig' => [ 'Mode' => 'Active|PassThrough', ], 'Version' => '<string>', 'VpcConfig' => [ '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
-
The AWS Lambda service encountered an internal error.
-
The request throughput limit was exceeded.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
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' => '', '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
Result Syntax
[ 'FunctionArns' => ['<string>', ...], 'NextMarker' => '<string>', ]
Result Details
Members
Errors
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource specified in the request does not exist.
ListLayerVersions
$result = $client->listLayerVersions
([/* ... */]); $promise = $client->listLayerVersionsAsync
([/* ... */]);
Lists the versions of an AWS 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.
Parameter Syntax
$result = $client->listLayerVersions([ 'CompatibleRuntime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2', 'LayerName' => '<string>', // REQUIRED 'Marker' => '<string>', 'MaxItems' => <integer>, ]);
Parameter Details
Members
Result Syntax
[ 'LayerVersions' => [ [ '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
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
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 AWS 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.
Parameter Syntax
$result = $client->listLayers([ 'CompatibleRuntime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2', 'Marker' => '<string>', 'MaxItems' => <integer>, ]);
Parameter Details
Members
Result Syntax
[ 'Layers' => [ [ 'LatestMatchingVersion' => [ '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
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
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 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
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 invalid.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
The AWS Lambda service encountered an internal error.
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's tags. You can also view tags with GetFunction.
Parameter Syntax
$result = $client->listTags([ 'Resource' => '<string>', // REQUIRED ]);
Parameter Details
Result Syntax
[ 'Tags' => ['<string>', ...], ]
Result Details
Members
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
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 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.
Result Syntax
[ 'NextMarker' => '<string>', 'Versions' => [ [ 'CodeSha256' => '<string>', 'CodeSize' => <integer>, 'DeadLetterConfig' => [ 'TargetArn' => '<string>', ], 'Description' => '<string>', 'Environment' => [ 'Error' => [ 'ErrorCode' => '<string>', 'Message' => '<string>', ], 'Variables' => ['<string>', ...], ], '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', 'Layers' => [ [ 'Arn' => '<string>', 'CodeSize' => <integer>, 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', ], // ... ], 'MasterArn' => '<string>', 'MemorySize' => <integer>, 'PackageType' => 'Zip|Image', 'RevisionId' => '<string>', 'Role' => '<string>', 'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2', 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', 'State' => 'Pending|Active|Inactive|Failed', 'StateReason' => '<string>', 'StateReasonCode' => 'Idle|Creating|Restoring|EniLimitExceeded|InsufficientRolePermissions|InvalidConfiguration|InternalError|SubnetOutOfIPAddresses|InvalidSubnet|InvalidSecurityGroup|ImageDeleted|ImageAccessDenied|InvalidImage', 'Timeout' => <integer>, 'TracingConfig' => [ 'Mode' => 'Active|PassThrough', ], 'Version' => '<string>', 'VpcConfig' => [ '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
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
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.', '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.', '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 AWS 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([ '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
- CompatibleRuntimes
-
- Type: Array of strings
A list of compatible function runtimes. Used for filtering with ListLayers and ListLayerVersions.
- 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
[ '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
- CompatibleRuntimes
-
- Type: Array of strings
The layer's compatible 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
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
You have exceeded your maximum total code size per account. Learn more
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.
AWS 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 '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 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.
- 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
[ 'CodeSha256' => '<string>', 'CodeSize' => <integer>, 'DeadLetterConfig' => [ 'TargetArn' => '<string>', ], 'Description' => '<string>', 'Environment' => [ 'Error' => [ 'ErrorCode' => '<string>', 'Message' => '<string>', ], 'Variables' => ['<string>', ...], ], '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', 'Layers' => [ [ 'Arn' => '<string>', 'CodeSize' => <integer>, 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', ], // ... ], 'MasterArn' => '<string>', 'MemorySize' => <integer>, 'PackageType' => 'Zip|Image', 'RevisionId' => '<string>', 'Role' => '<string>', 'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2', 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', 'State' => 'Pending|Active|Inactive|Failed', 'StateReason' => '<string>', 'StateReasonCode' => 'Idle|Creating|Restoring|EniLimitExceeded|InsufficientRolePermissions|InvalidConfiguration|InternalError|SubnetOutOfIPAddresses|InvalidSubnet|InvalidSecurityGroup|ImageDeleted|ImageAccessDenied|InvalidImage', 'Timeout' => <integer>, 'TracingConfig' => [ 'Mode' => 'Active|PassThrough', ], 'Version' => '<string>', 'VpcConfig' => [ 'SecurityGroupIds' => ['<string>', ...], 'SubnetIds' => ['<string>', ...], 'VpcId' => '<string>', ], ]
Result Details
Members
- 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.
- DeadLetterConfig
-
- Type: DeadLetterConfig structure
The function's dead letter queue.
- Description
-
- Type: string
The function's description.
- Environment
-
- Type: EnvironmentResponse structure
The function's environment variables.
- 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 executing your function.
- ImageConfigResponse
-
- Type: ImageConfigResponse structure
The function's image configuration values.
- KMSKeyArn
-
- Type: string
The KMS key that's used to encrypt the function's environment variables. This key is only returned if you've configured a customer managed CMK.
- 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.
- MasterArn
-
- Type: string
For Lambda@Edge functions, the ARN of the master 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 setZip
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 runtime environment for the Lambda function.
- SigningJobArn
-
- Type: string
The ARN of the signing job.
- SigningProfileVersionArn
-
- Type: string
The ARN of the signing profile version.
- 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. - 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 AWS X-Ray tracing configuration.
- Version
-
- Type: string
The version of the Lambda function.
- VpcConfig
-
- Type: VpcConfigResponse structure
The function's networking configuration.
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
-
You have exceeded your maximum total code size per account. Learn more
-
The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the
GetFunction
or theGetAlias
API to retrieve the latest RevisionId for your resource. -
The resource already exists, or another operation is in progress.
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 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 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
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
The resource already exists, or another operation is in progress.
-
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 Managing Concurrency.
Parameter Syntax
$result = $client->putFunctionConcurrency([ 'FunctionName' => '<string>', // REQUIRED 'ReservedConcurrentExecutions' => <integer>, // REQUIRED ]);
Parameter Details
Members
- FunctionName
-
- Required: Yes
- Type: string
The name 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.
- 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 Concurrency.
Errors
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The resource specified in the request does not exist.
-
The request throughput limit was exceeded.
-
The resource already exists, or another operation is in progress.
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, 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.
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 an SQS queue.
-
Topic - The ARN of an SNS topic.
-
Event Bus - The ARN of an Amazon EventBridge event bus.
- FunctionName
-
- Required: Yes
- Type: string
The name 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 an SQS queue.
-
Topic - The ARN of an SNS topic.
-
Event Bus - The ARN of an Amazon EventBridge event bus.
- 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
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
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, ]
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 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.
- 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.
- 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 invalid.
-
The resource specified in the request does not exist.
-
The resource already exists, or another operation is in progress.
-
The request throughput limit was exceeded.
-
The AWS Lambda service encountered an internal error.
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', ]
RemoveLayerVersionPermission
$result = $client->removeLayerVersionPermission
([/* ... */]); $promise = $client->removeLayerVersionPermissionAsync
([/* ... */]);
Removes a statement from the permissions policy for a version of an AWS 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
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
-
The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the
GetFunction
or theGetAlias
API 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 AWS service or another 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 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
Specify a version or alias to remove permissions from a published version of the function.
- RevisionId
-
- Type: string
Only update the policy 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
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
-
The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the
GetFunction
or theGetAlias
API 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', ]);
TagResource
$result = $client->tagResource
([/* ... */]); $promise = $client->tagResourceAsync
([/* ... */]);
Adds tags to a function.
Parameter Syntax
$result = $client->tagResource([ 'Resource' => '<string>', // REQUIRED 'Tags' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Members
Result Syntax
[]
Result Details
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
-
The resource already exists, or another operation is in progress.
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.
Parameter Syntax
$result = $client->untagResource([ 'Resource' => '<string>', // REQUIRED 'TagKeys' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Members
Result Syntax
[]
Result Details
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
-
The resource already exists, or another operation is in progress.
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 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
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
-
The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the
GetFunction
or theGetAlias
API to retrieve the latest RevisionId for your resource. -
The resource already exists, or another operation is in progress.
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, ], ], ]
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
-
The AWS Lambda service encountered an internal error.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
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 AWS Lambda invokes, or pause invocation and resume later from the same location.
The following error handling options are only available for stream sources (DynamoDB and Kinesis):
-
BisectBatchOnFunctionError
- If the function returns an error, split the batch in two and retry. -
DestinationConfig
- Send discarded records to an Amazon SQS queue or Amazon SNS topic. -
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. -
ParallelizationFactor
- Process multiple batches from each shard concurrently.
Parameter Syntax
$result = $client->updateEventSourceMapping([ 'BatchSize' => <integer>, 'BisectBatchOnFunctionError' => true || false, 'DestinationConfig' => [ 'OnFailure' => [ 'Destination' => '<string>', ], 'OnSuccess' => [ 'Destination' => '<string>', ], ], 'Enabled' => true || false, 'FunctionName' => '<string>', 'FunctionResponseTypes' => ['<string>', ...], 'MaximumBatchingWindowInSeconds' => <integer>, 'MaximumRecordAgeInSeconds' => <integer>, 'MaximumRetryAttempts' => <integer>, 'ParallelizationFactor' => <integer>, 'SourceAccessConfigurations' => [ [ 'Type' => 'BASIC_AUTH|VPC_SUBNET|VPC_SECURITY_GROUP|SASL_SCRAM_512_AUTH|SASL_SCRAM_256_AUTH', 'URI' => '<string>', ], // ... ], 'TumblingWindowInSeconds' => <integer>, 'UUID' => '<string>', // REQUIRED ]);
Parameter Details
Members
- BatchSize
-
- Type: int
The maximum number of items to retrieve in a single batch.
-
Amazon Kinesis - Default 100. Max 10,000.
-
Amazon DynamoDB Streams - Default 100. Max 1,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.
- BisectBatchOnFunctionError
-
- Type: boolean
(Streams) If the function returns an error, split the batch in two and retry.
- DestinationConfig
-
- Type: DestinationConfig structure
(Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
- Enabled
-
- Type: boolean
If true, the event source mapping is active. Set to false to pause polling and invocation.
- FunctionName
-
- Type: string
The name of the Lambda function.
Name formats
-
Function name -
MyFunction
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. -
Version or Alias ARN -
arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD
. -
Partial ARN -
123456789012:function:MyFunction
.
The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.
- FunctionResponseTypes
-
- Type: Array of strings
(Streams) A list of current response type enums applied to the event source mapping.
- MaximumBatchingWindowInSeconds
-
- Type: int
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds.
- MaximumRecordAgeInSeconds
-
- Type: int
(Streams) Discard records older than the specified age. The default value is infinite (-1).
- MaximumRetryAttempts
-
- Type: int
(Streams) Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records will be retried until the record expires.
- ParallelizationFactor
-
- Type: int
(Streams) The number of batches to process from each shard concurrently.
- SourceAccessConfigurations
-
- Type: Array of SourceAccessConfiguration structures
An array of the authentication protocol, or the VPC components to secure your event source.
- TumblingWindowInSeconds
-
- Type: int
(Streams) The duration of a processing window in seconds. The range is between 1 second up to 15 minutes.
- UUID
-
- Required: Yes
- Type: string
The identifier of the event source mapping.
Result Syntax
[ 'BatchSize' => <integer>, 'BisectBatchOnFunctionError' => true || false, 'DestinationConfig' => [ 'OnFailure' => [ 'Destination' => '<string>', ], 'OnSuccess' => [ 'Destination' => '<string>', ], ], 'EventSourceArn' => '<string>', 'FunctionArn' => '<string>', 'FunctionResponseTypes' => ['<string>', ...], 'LastModified' => <DateTime>, 'LastProcessingResult' => '<string>', 'MaximumBatchingWindowInSeconds' => <integer>, 'MaximumRecordAgeInSeconds' => <integer>, 'MaximumRetryAttempts' => <integer>, 'ParallelizationFactor' => <integer>, 'Queues' => ['<string>', ...], 'SelfManagedEventSource' => [ 'Endpoints' => [ '<EndPointType>' => ['<string>', ...], // ... ], ], 'SourceAccessConfigurations' => [ [ 'Type' => 'BASIC_AUTH|VPC_SUBNET|VPC_SECURITY_GROUP|SASL_SCRAM_512_AUTH|SASL_SCRAM_256_AUTH', 'URI' => '<string>', ], // ... ], 'StartingPosition' => 'TRIM_HORIZON|LATEST|AT_TIMESTAMP', 'StartingPositionTimestamp' => <DateTime>, 'State' => '<string>', 'StateTransitionReason' => '<string>', 'Topics' => ['<string>', ...], 'TumblingWindowInSeconds' => <integer>, 'UUID' => '<string>', ]
Result Details
Members
- BatchSize
-
- Type: int
The maximum number of items to retrieve in a single batch.
- BisectBatchOnFunctionError
-
- Type: boolean
(Streams) If the function returns an error, split the batch in two and retry. The default value is false.
- DestinationConfig
-
- Type: DestinationConfig structure
(Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
- EventSourceArn
-
- Type: string
The Amazon Resource Name (ARN) of the event source.
- FunctionArn
-
- Type: string
The ARN of the Lambda function.
- FunctionResponseTypes
-
- Type: Array of strings
(Streams) A list of current response type enums applied to the event source mapping.
- LastModified
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The date that the event source mapping was last updated, or its state changed.
- LastProcessingResult
-
- Type: string
The result of the last AWS Lambda invocation of your Lambda function.
- MaximumBatchingWindowInSeconds
-
- Type: int
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds. The default value is zero.
- MaximumRecordAgeInSeconds
-
- Type: int
(Streams) 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
-
- Type: int
(Streams) 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.
- ParallelizationFactor
-
- Type: int
(Streams) The number of batches to process from each shard concurrently. The default value is 1.
- Queues
-
- Type: Array of strings
(MQ) The name of the Amazon MQ broker destination queue to consume.
- SelfManagedEventSource
-
- Type: SelfManagedEventSource structure
The Self-Managed Apache Kafka cluster for your event source.
- SourceAccessConfigurations
-
- Type: Array of SourceAccessConfiguration structures
An array of the authentication protocol, or the VPC components to secure your event source.
- StartingPosition
-
- Type: string
The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources.
AT_TIMESTAMP
is only supported for Amazon Kinesis streams. - StartingPositionTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
With
StartingPosition
set toAT_TIMESTAMP
, the time from which to start reading. - State
-
- Type: string
The state of the event source mapping. It can be one of the following:
Creating
,Enabling
,Enabled
,Disabling
,Disabled
,Updating
, orDeleting
. - StateTransitionReason
-
- Type: string
Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service.
- Topics
-
- Type: Array of strings
The name of the Kafka topic.
- TumblingWindowInSeconds
-
- Type: int
(Streams) The duration of a processing window in seconds. The range is between 1 second up to 15 minutes.
- UUID
-
- Type: string
The identifier of the event source mapping.
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
-
The resource already exists, or another operation is in progress.
-
The operation conflicts with the resource's availability. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state.
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.
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([ 'DryRun' => true || false, 'FunctionName' => '<string>', // REQUIRED 'ImageUri' => '<string>', 'Publish' => true || false, 'RevisionId' => '<string>', 'S3Bucket' => '<string>', 'S3Key' => '<string>', 'S3ObjectVersion' => '<string>', 'ZipFile' => <string || resource || Psr\Http\Message\StreamInterface>, ]);
Parameter Details
Members
- 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 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.
- ImageUri
-
- Type: string
URI of a container image in the Amazon ECR registry.
- 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.
- RevisionId
-
- Type: string
Only update the function 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 AWS Region as your function. The bucket can be in a different AWS 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.
- ZipFile
-
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
The base64-encoded contents of the deployment package. AWS SDK and AWS CLI clients handle the encoding for you.
Result Syntax
[ 'CodeSha256' => '<string>', 'CodeSize' => <integer>, 'DeadLetterConfig' => [ 'TargetArn' => '<string>', ], 'Description' => '<string>', 'Environment' => [ 'Error' => [ 'ErrorCode' => '<string>', 'Message' => '<string>', ], 'Variables' => ['<string>', ...], ], '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', 'Layers' => [ [ 'Arn' => '<string>', 'CodeSize' => <integer>, 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', ], // ... ], 'MasterArn' => '<string>', 'MemorySize' => <integer>, 'PackageType' => 'Zip|Image', 'RevisionId' => '<string>', 'Role' => '<string>', 'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2', 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', 'State' => 'Pending|Active|Inactive|Failed', 'StateReason' => '<string>', 'StateReasonCode' => 'Idle|Creating|Restoring|EniLimitExceeded|InsufficientRolePermissions|InvalidConfiguration|InternalError|SubnetOutOfIPAddresses|InvalidSubnet|InvalidSecurityGroup|ImageDeleted|ImageAccessDenied|InvalidImage', 'Timeout' => <integer>, 'TracingConfig' => [ 'Mode' => 'Active|PassThrough', ], 'Version' => '<string>', 'VpcConfig' => [ 'SecurityGroupIds' => ['<string>', ...], 'SubnetIds' => ['<string>', ...], 'VpcId' => '<string>', ], ]
Result Details
Members
- 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.
- DeadLetterConfig
-
- Type: DeadLetterConfig structure
The function's dead letter queue.
- Description
-
- Type: string
The function's description.
- Environment
-
- Type: EnvironmentResponse structure
The function's environment variables.
- 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 executing your function.
- ImageConfigResponse
-
- Type: ImageConfigResponse structure
The function's image configuration values.
- KMSKeyArn
-
- Type: string
The KMS key that's used to encrypt the function's environment variables. This key is only returned if you've configured a customer managed CMK.
- 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.
- MasterArn
-
- Type: string
For Lambda@Edge functions, the ARN of the master 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 setZip
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 runtime environment for the Lambda function.
- SigningJobArn
-
- Type: string
The ARN of the signing job.
- SigningProfileVersionArn
-
- Type: string
The ARN of the signing profile version.
- 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. - 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 AWS X-Ray tracing configuration.
- Version
-
- Type: string
The version of the Lambda function.
- VpcConfig
-
- Type: VpcConfigResponse structure
The function's networking configuration.
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
-
You have exceeded your maximum total code size per account. Learn more
-
The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the
GetFunction
or theGetAlias
API to retrieve the latest RevisionId for your resource. -
The resource already exists, or another operation is in progress.
-
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.
-
InvalidCodeSignatureException:
The code signature failed the integrity check. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN.
-
CodeSigningConfigNotFoundException:
The specified code signing configuration does not exist.
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 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 account or AWS service, use AddPermission.
Parameter Syntax
$result = $client->updateFunctionConfiguration([ 'DeadLetterConfig' => [ 'TargetArn' => '<string>', ], 'Description' => '<string>', 'Environment' => [ 'Variables' => ['<string>', ...], ], 'FileSystemConfigs' => [ [ 'Arn' => '<string>', // REQUIRED 'LocalMountPath' => '<string>', // REQUIRED ], // ... ], 'FunctionName' => '<string>', // REQUIRED 'Handler' => '<string>', 'ImageConfig' => [ 'Command' => ['<string>', ...], 'EntryPoint' => ['<string>', ...], 'WorkingDirectory' => '<string>', ], 'KMSKeyArn' => '<string>', 'Layers' => ['<string>', ...], 'MemorySize' => <integer>, 'RevisionId' => '<string>', 'Role' => '<string>', 'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2', 'Timeout' => <integer>, 'TracingConfig' => [ 'Mode' => 'Active|PassThrough', ], 'VpcConfig' => [ 'SecurityGroupIds' => ['<string>', ...], 'SubnetIds' => ['<string>', ...], ], ]);
Parameter Details
Members
- 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.
- Environment
-
- Type: Environment structure
Environment variables that are accessible from function code during execution.
- FileSystemConfigs
-
- Type: Array of FileSystemConfig structures
Connection settings for an Amazon EFS file system.
- FunctionName
-
- Required: Yes
- Type: string
The name of the Lambda function.
Name formats
-
Function name -
my-function
. -
Function ARN -
arn:aws:lambda:us-west-2:123456789012:function:my-function
. -
Partial ARN -
123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
- Handler
-
- Type: string
The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Programming Model.
- ImageConfig
-
- Type: ImageConfig structure
Configuration values that override the container image Dockerfile.
- KMSKeyArn
-
- Type: string
The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service 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.
- MemorySize
-
- Type: int
The amount of memory available to the function at runtime. Increasing the function's memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB.
- RevisionId
-
- Type: string
Only update the function 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.
- Timeout
-
- Type: int
The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.
- TracingConfig
-
- Type: TracingConfig structure
Set
Mode
toActive
to sample and trace a subset of incoming requests with AWS X-Ray. - VpcConfig
-
- Type: VpcConfig structure
For network connectivity to AWS 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 only access resources and the internet through that VPC. For more information, see VPC Settings.
Result Syntax
[ 'CodeSha256' => '<string>', 'CodeSize' => <integer>, 'DeadLetterConfig' => [ 'TargetArn' => '<string>', ], 'Description' => '<string>', 'Environment' => [ 'Error' => [ 'ErrorCode' => '<string>', 'Message' => '<string>', ], 'Variables' => ['<string>', ...], ], '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', 'Layers' => [ [ 'Arn' => '<string>', 'CodeSize' => <integer>, 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', ], // ... ], 'MasterArn' => '<string>', 'MemorySize' => <integer>, 'PackageType' => 'Zip|Image', 'RevisionId' => '<string>', 'Role' => '<string>', 'Runtime' => 'nodejs|nodejs4.3|nodejs6.10|nodejs8.10|nodejs10.x|nodejs12.x|java8|java8.al2|java11|python2.7|python3.6|python3.7|python3.8|dotnetcore1.0|dotnetcore2.0|dotnetcore2.1|dotnetcore3.1|nodejs4.3-edge|go1.x|ruby2.5|ruby2.7|provided|provided.al2', 'SigningJobArn' => '<string>', 'SigningProfileVersionArn' => '<string>', 'State' => 'Pending|Active|Inactive|Failed', 'StateReason' => '<string>', 'StateReasonCode' => 'Idle|Creating|Restoring|EniLimitExceeded|InsufficientRolePermissions|InvalidConfiguration|InternalError|SubnetOutOfIPAddresses|InvalidSubnet|InvalidSecurityGroup|ImageDeleted|ImageAccessDenied|InvalidImage', 'Timeout' => <integer>, 'TracingConfig' => [ 'Mode' => 'Active|PassThrough', ], 'Version' => '<string>', 'VpcConfig' => [ 'SecurityGroupIds' => ['<string>', ...], 'SubnetIds' => ['<string>', ...], 'VpcId' => '<string>', ], ]
Result Details
Members
- 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.
- DeadLetterConfig
-
- Type: DeadLetterConfig structure
The function's dead letter queue.
- Description
-
- Type: string
The function's description.
- Environment
-
- Type: EnvironmentResponse structure
The function's environment variables.
- 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 executing your function.
- ImageConfigResponse
-
- Type: ImageConfigResponse structure
The function's image configuration values.
- KMSKeyArn
-
- Type: string
The KMS key that's used to encrypt the function's environment variables. This key is only returned if you've configured a customer managed CMK.
- 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.
- MasterArn
-
- Type: string
For Lambda@Edge functions, the ARN of the master 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 setZip
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 runtime environment for the Lambda function.
- SigningJobArn
-
- Type: string
The ARN of the signing job.
- SigningProfileVersionArn
-
- Type: string
The ARN of the signing profile version.
- 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. - 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 AWS X-Ray tracing configuration.
- Version
-
- Type: string
The version of the Lambda function.
- VpcConfig
-
- Type: VpcConfigResponse structure
The function's networking configuration.
Errors
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
-
The resource already exists, or another operation is in progress.
-
The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the
GetFunction
or theGetAlias
API to retrieve the latest RevisionId for your resource. -
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.
-
InvalidCodeSignatureException:
The code signature failed the integrity check. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN.
-
CodeSigningConfigNotFoundException:
The specified code signing configuration does not exist.
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([ 'FunctionName' => 'my-function', 'MemorySize' => 256, ]);
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' => 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 an SQS queue.
-
Topic - The ARN of an SNS topic.
-
Event Bus - The ARN of an Amazon EventBridge event bus.
- FunctionName
-
- Required: Yes
- Type: string
The name 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 an SQS queue.
-
Topic - The ARN of an SNS topic.
-
Event Bus - The ARN of an Amazon EventBridge event bus.
- 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
-
The AWS Lambda service encountered an internal error.
-
The resource specified in the request does not exist.
-
InvalidParameterValueException:
One of the parameters in the request is invalid.
-
The request throughput limit was exceeded.
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, ]
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 AWS 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
AliasRoutingConfiguration
AllowedPublishers
Description
List of signing profiles that can sign a code package.
Members
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
CodeSigningPolicies
Description
Code signing configuration policies specifies 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 toWarn
, Lambda allows the deployment and creates a CloudWatch log.Default value:
Warn
CodeStorageExceededException
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
DeadLetterConfig
DestinationConfig
Description
A configuration object that specifies the destination of an event after Lambda processes it.
Members
EC2AccessDeniedException
Description
Need additional permissions to configure VPC settings.
Members
EC2ThrottledException
Description
AWS Lambda was throttled by Amazon EC2 during Lambda function initialization using the execution role provided for the Lambda function.
Members
EC2UnexpectedException
Description
AWS Lambda received an unexpected EC2 client exception while setting up for the Lambda function.
Members
EFSIOException
Description
An error occured when reading from or writing to a connected file system.
Members
EFSMountConnectivityException
Description
The function couldn't make a network connection to the configured file system.
Members
EFSMountFailureException
Description
The function couldn't mount the configured file system due to a permission or configuration issue.
Members
EFSMountTimeoutException
Description
The function was able to make a network connection to the configured file system, but the mount operation timed out.
Members
ENILimitReachedException
Description
AWS Lambda was not able to create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached.
Members
Environment
Description
A function's environment variable settings.
Members
EnvironmentError
Description
Error messages for environment variables that couldn't be applied.
Members
EnvironmentResponse
Description
The results of an operation to update or read environment variables. If the operation is successful, the response contains the environment variables. If it failed, 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.
FileSystemConfig
Description
Details about the connection between a Lambda function and an Amazon EFS file system.
Members
FunctionCode
Description
The code for the Lambda function. You can specify either 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 AWS Region as your function. The bucket can be in a different AWS 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.
- ZipFile
-
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
The base64-encoded contents of the deployment package. AWS SDK and AWS CLI clients handle the encoding for you.
FunctionCodeLocation
Description
Details about a function's deployment package.
Members
ImageConfig
Description
Configuration values that override the container image Dockerfile settings. See Container settings.
Members
ImageConfigError
Description
Error response to GetFunctionConfiguration.
Members
ImageConfigResponse
Description
Response to GetFunctionConfiguration request.
Members
- Error
-
- Type: ImageConfigError structure
Error response to GetFunctionConfiguration.
- ImageConfig
-
- Type: ImageConfig structure
Configuration values that override the container image Dockerfile.
InvalidCodeSignatureException
Description
The code signature failed the integrity check. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN.
Members
InvalidParameterValueException
Description
One of the parameters in the request is invalid.
Members
InvalidRequestContentException
Description
The request body could not be parsed as JSON.
Members
InvalidRuntimeException
Description
The runtime or runtime version specified is not supported.
Members
InvalidSecurityGroupIDException
Description
The Security Group ID provided in the Lambda function VPC configuration is invalid.
Members
InvalidSubnetIDException
Description
The Subnet ID provided in the Lambda function VPC configuration is invalid.
Members
InvalidZipFileException
Description
AWS Lambda could not unzip the deployment package.
Members
KMSAccessDeniedException
Description
Lambda was unable to decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.
Members
KMSDisabledException
Description
Lambda was unable to decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.
Members
KMSInvalidStateException
Description
Lambda was unable to decrypt the environment variables because the KMS key used is in an invalid state for Decrypt. Check the function's KMS key settings.
Members
KMSNotFoundException
Description
Lambda was unable to decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.
Members
Layer
Description
An AWS Lambda layer.
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 AWS 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. AWS SDK and AWS CLI clients handle the encoding for you.
LayerVersionContentOutput
Description
Details about a version of an AWS 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 AWS Lambda layer.
Members
- CompatibleRuntimes
-
- Type: Array of strings
The layer's compatible 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 AWS 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.
OnFailure
Description
A destination for events that failed processing.
Members
OnSuccess
Description
A destination for events that were processed successfully.
Members
PolicyLengthExceededException
PreconditionFailedException
Description
The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the GetFunction
or the GetAlias
API to retrieve the latest RevisionId for your resource.
Members
ProvisionedConcurrencyConfigListItem
Description
Details about the provisioned concurrency configuration for a function alias or version.
Members
- AllocatedProvisionedConcurrentExecutions
-
- Type: int
The amount of provisioned concurrency allocated.
- 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
RequestTooLargeException
Description
The request payload exceeded the Invoke
request body JSON input limit. For more information, see Limits.
Members
ResourceConflictException
Description
The resource already exists, or another operation is in progress.
Members
ResourceInUseException
Description
The operation conflicts with the resource's availability. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state.
Members
ResourceNotFoundException
Description
The resource specified in the request does not exist.
Members
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
SelfManagedEventSource
Description
The Self-Managed Apache Kafka cluster for your event source.
Members
ServiceException
Description
The AWS Lambda service encountered an internal error.
Members
SourceAccessConfiguration
Description
You can specify the authentication protocol, or the VPC components to secure access to your event source.
Members
- Type
-
- Type: string
The type of authentication protocol or the VPC components for your event source. For example:
"Type":"SASL_SCRAM_512_AUTH"
.-
BASIC_AUTH
- (MQ) The Secrets Manager secret that stores your broker credentials. -
VPC_SUBNET
- The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your Kafka cluster. -
VPC_SECURITY_GROUP
- The VPC security group used to manage access to your Kafka brokers. -
SASL_SCRAM_256_AUTH
- The ARN of your secret key used for SASL SCRAM-256 authentication of your Kafka brokers. -
SASL_SCRAM_512_AUTH
- The ARN of your secret key used for SASL SCRAM-512 authentication of your 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"
.
SubnetIPAddressLimitReachedException
Description
AWS Lambda was not able to set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses.
Members
TooManyRequestsException
Description
The request throughput limit was exceeded.
Members
TracingConfig
Description
The function's AWS X-Ray tracing configuration. To sample and record incoming requests, set Mode
to Active
.
Members
TracingConfigResponse
Description
The function's AWS X-Ray tracing configuration.
Members
UnsupportedMediaTypeException
Description
The content type of the Invoke
request body is not JSON.
Members
VpcConfig
Description
The VPC security groups and subnets that are attached to a Lambda function. For more information, see VPC Settings.