Class CapacityProvider
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.lambda.CapacityProvider
- All Implemented Interfaces:
IEnvironmentAware,IResource,ICapacityProvider,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-12T17:54:16.191Z")
@Stability(Stable)
public class CapacityProvider
extends Resource
implements ICapacityProvider
A Lambda capacity provider that manages compute resources for Lambda functions.
Example:
import software.amazon.awscdk.services.ec2.*;
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))
.scalingOptions(ScalingOptions.manual(List.of(TargetTrackingScalingPolicy.cpuUtilization(70))))
.build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.lambda.ICapacityProvider
ICapacityProvider.Jsii$Default, ICapacityProvider.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCapacityProvider(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCapacityProvider(software.amazon.jsii.JsiiObjectRef objRef) CapacityProvider(software.constructs.Construct scope, String id, CapacityProviderProps props) Creates a new Lambda capacity provider. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFunction(IFunction func) Configures a Lambda function to use this capacity provider.voidaddFunction(IFunction func, CapacityProviderFunctionOptions options) Configures a Lambda function to use this capacity provider.static ICapacityProviderfromCapacityProviderArn(software.constructs.Construct scope, String id, String capacityProviderArn) Import an existing capacity provider by ARN.static ICapacityProviderfromCapacityProviderAttributes(software.constructs.Construct scope, String id, CapacityProviderAttributes attrs) Import an existing capacity provider using its attributes.static ICapacityProviderfromCapacityProviderName(software.constructs.Construct scope, String id, String capacityProviderName) Import an existing capacity provider by name.The Amazon Resource Name (ARN) of the capacity provider.The name of the capacity provider.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
CapacityProvider
protected CapacityProvider(software.amazon.jsii.JsiiObjectRef objRef) -
CapacityProvider
protected CapacityProvider(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CapacityProvider
@Stability(Stable) public CapacityProvider(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CapacityProviderProps props) Creates a new Lambda capacity provider.- Parameters:
scope- The parent construct. This parameter is required.id- The construct ID. This parameter is required.props- The capacity provider properties. This parameter is required.
-
-
Method Details
-
fromCapacityProviderArn
@Stability(Stable) @NotNull public static ICapacityProvider fromCapacityProviderArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String capacityProviderArn) Import an existing capacity provider by ARN.- Parameters:
scope- The parent construct. This parameter is required.id- The construct ID. This parameter is required.capacityProviderArn- The ARN of the capacity provider to import. This parameter is required.
-
fromCapacityProviderAttributes
@Stability(Stable) @NotNull public static ICapacityProvider fromCapacityProviderAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CapacityProviderAttributes attrs) Import an existing capacity provider using its attributes.- Parameters:
scope- The parent construct. This parameter is required.id- The construct ID. This parameter is required.attrs- The capacity provider attributes. This parameter is required.
-
fromCapacityProviderName
@Stability(Stable) @NotNull public static ICapacityProvider fromCapacityProviderName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String capacityProviderName) Import an existing capacity provider by name.- Parameters:
scope- The parent construct. This parameter is required.id- The construct ID. This parameter is required.capacityProviderName- The name of the capacity provider to import. This parameter is required.
-
addFunction
@Stability(Stable) public void addFunction(@NotNull IFunction func, @Nullable CapacityProviderFunctionOptions options) Configures a Lambda function to use this capacity provider.- Parameters:
func- The Lambda function to configure. This parameter is required.options- Optional configuration for the function's capacity provider settings.
-
addFunction
Configures a Lambda function to use this capacity provider.- Parameters:
func- The Lambda function to configure. This parameter is required.
-
getCapacityProviderArn
The Amazon Resource Name (ARN) of the capacity provider.- Specified by:
getCapacityProviderArnin interfaceICapacityProvider
-
getCapacityProviderName
The name of the capacity provider.- Specified by:
getCapacityProviderNamein interfaceICapacityProvider
-