interface CapacityProviderProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Lambda.CapacityProviderProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslambda#CapacityProviderProps |
Java | software.amazon.awscdk.services.lambda.CapacityProviderProps |
Python | aws_cdk.aws_lambda.CapacityProviderProps |
TypeScript (source) | aws-cdk-lib » aws_lambda » CapacityProviderProps |
Properties for creating a Lambda capacity provider.
Example
import * as ec2 from 'aws-cdk-lib/aws-ec2';
const vpc = new ec2.Vpc(this, 'MyVpc');
const securityGroup = new ec2.SecurityGroup(this, 'SecurityGroup', { vpc });
const capacityProvider = new lambda.CapacityProvider(this, 'MyCapacityProvider', {
subnets: vpc.privateSubnets,
securityGroups: [securityGroup],
scalingOptions: lambda.ScalingOptions.manual([
lambda.TargetTrackingScalingPolicy.cpuUtilization(70),
]),
});
Properties
| Name | Type | Description |
|---|---|---|
| security | ISecurity[] | A list of security group IDs to associate with EC2 instances launched by the capacity provider. |
| subnets | ISubnet[] | A list of subnets where the capacity provider can launch EC2 instances. |
| architectures? | Architecture[] | The instruction set architecture required for compute instances. |
| capacity | string | The name of the capacity provider. |
| instance | Instance | Configuration for filtering instance types that the capacity provider can use. |
| kms | IKey | The AWS Key Management Service (KMS) key used to encrypt data associated with the capacity provider. |
| max | number | The maximum number of vCPUs that the capacity provider can scale up to. |
| operator | IRole | The IAM role that the Lambda service assumes to manage the capacity provider. |
| scaling | Scaling | The options for scaling a capacity provider, including scaling policies. |
securityGroups
Type:
ISecurity[]
A list of security group IDs to associate with EC2 instances launched by the capacity provider.
Up to 5 security groups can be specified.
subnets
Type:
ISubnet[]
A list of subnets where the capacity provider can launch EC2 instances.
At least one subnet must be specified, and up to 16 subnets are supported.
architectures?
Type:
Architecture[]
(optional, default: No architecture constraints specified)
The instruction set architecture required for compute instances.
Only one architecture can be specified per capacity provider.
capacityProviderName?
Type:
string
(optional, default: AWS CloudFormation generates a unique physical ID and uses that
ID for the capacity provider's name.)
The name of the capacity provider.
The name must be unique within the AWS account and region.
instanceTypeFilter?
Type:
Instance
(optional, default: No instance type filtering applied)
Configuration for filtering instance types that the capacity provider can use.
kmsKey?
Type:
IKey
(optional, default: No KMS key specified, uses an AWS-managed key instead)
The AWS Key Management Service (KMS) key used to encrypt data associated with the capacity provider.
maxVCpuCount?
Type:
number
(optional, default: No maximum limit specified, service default is 400)
The maximum number of vCPUs that the capacity provider can scale up to.
operatorRole?
Type:
IRole
(optional, default: A role will be generated containing the AWSLambdaManagedEC2ResourceOperator managed policy)
The IAM role that the Lambda service assumes to manage the capacity provider.
scalingOptions?
Type:
Scaling
(optional, default: The Auto option is applied by default)
The options for scaling a capacity provider, including scaling policies.

.NET
Go
Java
Python
TypeScript (