interface CapacityProviderFunctionOptions
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Lambda.CapacityProviderFunctionOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslambda#CapacityProviderFunctionOptions |
Java | software.amazon.awscdk.services.lambda.CapacityProviderFunctionOptions |
Python | aws_cdk.aws_lambda.CapacityProviderFunctionOptions |
TypeScript (source) | aws-cdk-lib » aws_lambda » CapacityProviderFunctionOptions |
Options for creating a function associated with a capacity provider.
Example
declare const capacityProvider: lambda.CapacityProvider;
const fn = new lambda.Function(this, 'MyFunction', {
// Runtime must be equal to or newer than NODEJS_22_X
runtime: lambda.Runtime.NODEJS_22_X,
handler: 'index.handler',
code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
});
// Associate the function with the capacity provider
capacityProvider.addFunction(fn, {
perExecutionEnvironmentMaxConcurrency: 10,
executionEnvironmentMemoryGiBPerVCpu: 4,
});
Properties
| Name | Type | Description |
|---|---|---|
| execution | number | Specifies the execution environment memory per VCPU, in GiB. |
| latest | Latest | The scaling options that are applied to the $LATEST.PUBLISHED version. |
| per | number | Specifies the maximum number of concurrent invokes a single execution environment can handle. |
| publish | boolean | A boolean determining whether or not to automatically publish to the $LATEST.PUBLISHED version. |
executionEnvironmentMemoryGiBPerVCpu?
Type:
number
(optional, default: 2.0)
Specifies the execution environment memory per VCPU, in GiB.
latestPublishedScalingConfig?
Type:
Latest
(optional, default: No scaling limitations are applied to the $LATEST.PUBLISHED version.)
The scaling options that are applied to the $LATEST.PUBLISHED version.
perExecutionEnvironmentMaxConcurrency?
Type:
number
(optional, default: Maximum is set to 10)
Specifies the maximum number of concurrent invokes a single execution environment can handle.
publishToLatestPublished?
Type:
boolean
(optional, default: True)
A boolean determining whether or not to automatically publish to the $LATEST.PUBLISHED version.

.NET
Go
Java
Python
TypeScript (