Interface CapacityProviderProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CapacityProviderProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.138.0 (build 0ca7ee8)", date="2026-08-10T14:51:05.961Z") @Stability(Stable) public interface CapacityProviderProps extends software.amazon.jsii.JsiiSerializable
Properties for creating a Lambda capacity provider.

Example:

 import software.amazon.awscdk.services.ec2.*;
 import software.amazon.awscdk.services.logs.*;
 Vpc vpc = new Vpc(this, "MyVpc");
 SecurityGroup securityGroup = SecurityGroup.Builder.create(this, "SecurityGroup").vpc(vpc).build();
 CapacityProvider capacityProvider = CapacityProvider.Builder.create(this, "MyCapacityProvider")
         .subnets(vpc.getPrivateSubnets())
         .securityGroups(List.of(securityGroup))
         .logGroup(LogGroup.Builder.create(this, "CpLogs")
                 .logGroupName("/aws/lambda/capacity-provider/my-cp")
                 .build())
         .systemLogLevel(SystemLogLevel.DEBUG)
         .build();
 
  • Method Details

    • getSecurityGroups

      @Stability(Stable) @NotNull List<ISecurityGroup> getSecurityGroups()
      A list of security group IDs to associate with EC2 instances launched by the capacity provider.

      Up to 5 security groups can be specified.

    • getSubnets

      @Stability(Stable) @NotNull List<ISubnet> getSubnets()
      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.

    • getArchitectures

      @Stability(Stable) @Nullable default List<Architecture> getArchitectures()
      The instruction set architecture required for compute instances.

      Only one architecture can be specified per capacity provider.

      Default: - No architecture constraints specified

    • getCapacityProviderName

      @Stability(Stable) @Nullable default String getCapacityProviderName()
      The name of the capacity provider.

      The name must be unique within the AWS account and region.

      Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the capacity provider's name.

    • getInstanceTypeFilter

      @Stability(Stable) @Nullable default InstanceTypeFilter getInstanceTypeFilter()
      Configuration for filtering instance types that the capacity provider can use.

      Default: - No instance type filtering applied

    • getKmsKey

      @Stability(Stable) @Nullable default IKey getKmsKey()
      The AWS Key Management Service (KMS) key used to encrypt data associated with the capacity provider.

      Default: - No KMS key specified, uses an AWS-managed key instead

    • getLogGroup

      @Stability(Stable) @Nullable default ILogGroupRef getLogGroup()
      The CloudWatch log group for capacity provider system logs.

      Default: - Service creates a default log group at /aws/lambda/capacity-provider/

    • getMaxVCpuCount

      @Stability(Stable) @Nullable default Number getMaxVCpuCount()
      The maximum number of vCPUs that the capacity provider can scale up to.

      Default: - No maximum limit specified, service default is 400

    • getOperatorRole

      @Stability(Stable) @Nullable default IRole getOperatorRole()
      The IAM role that the Lambda service assumes to manage the capacity provider.

      Default: - A role will be generated containing the AWSLambdaManagedEC2ResourceOperator managed policy

    • getPropagateTags

      @Stability(Stable) @Nullable default PropagateTags getPropagateTags()
      Configuration for tag propagation to managed resources (EC2 instances, ENIs, EBS volumes).

      Use the static factory methods on PropagateTags to create:

      • PropagateTags.none() - Explicitly disable tag propagation
      • PropagateTags.explicit(tags) - Propagate specified tags

      Default: - No tag propagation; tags are not propagated to managed resources.

    • getScalingOptions

      @Stability(Stable) @Nullable default ScalingOptions getScalingOptions()
      The options for scaling a capacity provider, including scaling policies.

      Default: - The `Auto` option is applied by default

    • getSystemLogLevel

      @Stability(Stable) @Nullable default SystemLogLevel getSystemLogLevel()
      The level of detail for capacity provider system logs.

      Default: - Service default applies (INFO)

    • builder

      @Stability(Stable) static CapacityProviderProps.Builder builder()
      Returns:
      a CapacityProviderProps.Builder of CapacityProviderProps