CapacityProviderConfig
Configures the capacity provider to which published versions of the function will be attached. This enables the function to run on customer-owned EC2 instances managed by Lambda.
Note
This configuration determines the compute type of a function and needs to be specified during the first function deployment. It can't be added or removed after the function resource has been created.
Syntax
To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.
YAML
Arn:StringExecutionEnvironmentMemoryGiBPerVCpu:FloatPerExecutionEnvironmentMaxConcurrency:Integer
Properties
-
Arn -
The ARN of the capacity provider to use for this function.
Type: String
Required: Yes
CloudFormation compatibility: This property is unique to SAM.
-
ExecutionEnvironmentMemoryGiBPerVCpu -
The ratio of memory (in GiB) to vCPU for each execution environment.
Note
The memory ratio per CPU can't exceed function's total memory of 2048MB. The supported memory-to-CPU ratios are 2GB, 4GB, or 8GB per CPU.
Type: Float
Required: No
CloudFormation compatibility: This property is passed directly to the
ExecutionEnvironmentMemoryGiBPerVCpuproperty of anAWS::Lambda::Functionresource. -
PerExecutionEnvironmentMaxConcurrency -
The maximum number of concurrent executions per execution environment (sandbox).
Type: Integer
Required: No
CloudFormation compatibility: This property is passed directly to the
PerExecutionEnvironmentMaxConcurrencyproperty of anAWS::Lambda::Functionresource.
Examples
Capacity provider configuration
The following example shows a capacity provider configuration that references a capacity provider resource.
CapacityProviderConfig: Arn: !GetAttMyCapacityProvider.Arn ExecutionEnvironmentMemoryGiBPerVCpu: 4.0 PerExecutionEnvironmentMaxConcurrency: 100