Class CapacityProvider
A Lambda capacity provider that manages compute resources for Lambda functions.
Inherited Members
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CapacityProvider : Resource, ICapacityProvider, IResource, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class CapacityProvider Inherits Resource Implements ICapacityProvider, IResource, IConstruct, IDependable, IEnvironmentAware
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.EC2;
var vpc = new Vpc(this, "MyVpc");
var securityGroup = new SecurityGroup(this, "SecurityGroup", new SecurityGroupProps { Vpc = vpc });
var capacityProvider = new CapacityProvider(this, "MyCapacityProvider", new CapacityProviderProps {
Subnets = vpc.PrivateSubnets,
SecurityGroups = new [] { securityGroup },
ScalingOptions = ScalingOptions.Manual(new [] { TargetTrackingScalingPolicy.CpuUtilization(70) })
});
Synopsis
Constructors
| CapacityProvider(Construct, string, ICapacityProviderProps) | Creates a new Lambda capacity provider. |
Properties
| CapacityProviderArn | The Amazon Resource Name (ARN) of the capacity provider. |
| CapacityProviderName | The name of the capacity provider. |
| PROPERTY_INJECTION_ID | Uniquely identifies this class. |
Methods
| AddFunction(IFunction, ICapacityProviderFunctionOptions?) | Configures a Lambda function to use this capacity provider. |
| FromCapacityProviderArn(Construct, string, string) | Import an existing capacity provider by ARN. |
| FromCapacityProviderAttributes(Construct, string, ICapacityProviderAttributes) | Import an existing capacity provider using its attributes. |
| FromCapacityProviderName(Construct, string, string) | Import an existing capacity provider by name. |
Constructors
CapacityProvider(Construct, string, ICapacityProviderProps)
Creates a new Lambda capacity provider.
public CapacityProvider(Construct scope, string id, ICapacityProviderProps props)
Parameters
- scope Construct
The parent construct.
- id string
The construct ID.
- props ICapacityProviderProps
The capacity provider properties.
Remarks
ExampleMetadata: infused
Properties
CapacityProviderArn
The Amazon Resource Name (ARN) of the capacity provider.
public virtual string CapacityProviderArn { get; }
Property Value
Remarks
ExampleMetadata: infused
CapacityProviderName
The name of the capacity provider.
public virtual string CapacityProviderName { get; }
Property Value
Remarks
ExampleMetadata: infused
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
ExampleMetadata: infused
Methods
AddFunction(IFunction, ICapacityProviderFunctionOptions?)
Configures a Lambda function to use this capacity provider.
public virtual void AddFunction(IFunction func, ICapacityProviderFunctionOptions? options = null)
Parameters
- func IFunction
The Lambda function to configure.
- options ICapacityProviderFunctionOptions
Optional configuration for the function's capacity provider settings.
Remarks
ExampleMetadata: infused
FromCapacityProviderArn(Construct, string, string)
Import an existing capacity provider by ARN.
public static ICapacityProvider FromCapacityProviderArn(Construct scope, string id, string capacityProviderArn)
Parameters
- scope Construct
The parent construct.
- id string
The construct ID.
- capacityProviderArn string
The ARN of the capacity provider to import.
Returns
Remarks
ExampleMetadata: infused
FromCapacityProviderAttributes(Construct, string, ICapacityProviderAttributes)
Import an existing capacity provider using its attributes.
public static ICapacityProvider FromCapacityProviderAttributes(Construct scope, string id, ICapacityProviderAttributes attrs)
Parameters
- scope Construct
The parent construct.
- id string
The construct ID.
- attrs ICapacityProviderAttributes
The capacity provider attributes.
Returns
Remarks
ExampleMetadata: infused
FromCapacityProviderName(Construct, string, string)
Import an existing capacity provider by name.
public static ICapacityProvider FromCapacityProviderName(Construct scope, string id, string capacityProviderName)
Parameters
- scope Construct
The parent construct.
- id string
The construct ID.
- capacityProviderName string
The name of the capacity provider to import.
Returns
Remarks
ExampleMetadata: infused