class LambdaDeploymentConfig (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CodeDeploy.LambdaDeploymentConfig |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscodedeploy#LambdaDeploymentConfig |
Java | software.amazon.awscdk.services.codedeploy.LambdaDeploymentConfig |
Python | aws_cdk.aws_codedeploy.LambdaDeploymentConfig |
TypeScript (source) | aws-cdk-lib » aws_codedeploy » LambdaDeploymentConfig |
Implements
IConstruct
, IDependable
, IResource
, IBase
, ILambda
A custom Deployment Configuration for a Lambda Deployment Group.
Example
const config = new codedeploy.LambdaDeploymentConfig(this, 'CustomConfig', {
trafficRouting: new codedeploy.TimeBasedCanaryTrafficRouting({
interval: Duration.minutes(15),
percentage: 5,
}),
});
declare const application: codedeploy.LambdaApplication;
declare const alias: lambda.Alias;
const deploymentGroup = new codedeploy.LambdaDeploymentGroup(this, 'BlueGreenDeployment', {
application,
alias,
deploymentConfig: config,
});
Initializer
new LambdaDeploymentConfig(scope: Construct, id: string, props?: LambdaDeploymentConfigProps)
Parameters
- scope
Construct
- id
string
- props
Lambda
Deployment Config Props
Construct Props
Name | Type | Description |
---|---|---|
deployment | string | The physical, human-readable name of the Deployment Configuration. |
traffic | Traffic | The configuration that specifies how traffic is shifted from the 'blue' target group to the 'green' target group during a deployment. |
deploymentConfigName?
Type:
string
(optional, default: automatically generated name)
The physical, human-readable name of the Deployment Configuration.
trafficRouting?
Type:
Traffic
(optional, default: AllAtOnce)
The configuration that specifies how traffic is shifted from the 'blue' target group to the 'green' target group during a deployment.
Properties
Name | Type | Description |
---|---|---|
deployment | string | The arn of the deployment config. |
deployment | string | The name of the deployment config. |
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
static ALL_AT_ONCE | ILambda | CodeDeploy predefined deployment configuration that shifts all traffic to the updated Lambda function at once. |
static CANARY_10 | ILambda | CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment. |
static CANARY_10 | ILambda | CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment. |
static CANARY_10 | ILambda | CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment. |
static CANARY_10 | ILambda | CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment. |
static LINEAR_10 | ILambda | CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every 10 minutes until all traffic is shifted. |
static LINEAR_10 | ILambda | CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every minute until all traffic is shifted. |
static LINEAR_10 | ILambda | CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every two minutes until all traffic is shifted. |
static LINEAR_10 | ILambda | CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every three minutes until all traffic is shifted. |
deploymentConfigArn
Type:
string
The arn of the deployment config.
deploymentConfigName
Type:
string
The name of the deployment config.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
static ALL_AT_ONCE
Type:
ILambda
CodeDeploy predefined deployment configuration that shifts all traffic to the updated Lambda function at once.
static CANARY_10PERCENT_10MINUTES
Type:
ILambda
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.
The remaining 90 percent is deployed 10 minutes later.
static CANARY_10PERCENT_15MINUTES
Type:
ILambda
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.
The remaining 90 percent is deployed 15 minutes later.
static CANARY_10PERCENT_30MINUTES
Type:
ILambda
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.
The remaining 90 percent is deployed 30 minutes later.
static CANARY_10PERCENT_5MINUTES
Type:
ILambda
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic in the first increment.
The remaining 90 percent is deployed five minutes later.
static LINEAR_10PERCENT_EVERY_10MINUTES
Type:
ILambda
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every 10 minutes until all traffic is shifted.
static LINEAR_10PERCENT_EVERY_1MINUTE
Type:
ILambda
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every minute until all traffic is shifted.
static LINEAR_10PERCENT_EVERY_2MINUTES
Type:
ILambda
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every two minutes until all traffic is shifted.
static LINEAR_10PERCENT_EVERY_3MINUTES
Type:
ILambda
CodeDeploy predefined deployment configuration that shifts 10 percent of traffic every three minutes until all traffic is shifted.
Methods
Name | Description |
---|---|
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
static from | Import a Deployment Configuration for a Lambda Deployment Group defined outside the CDK. |
static import(_scope, _id, props) | Import a Deployment Configuration for a Lambda Deployment Group defined outside the CDK. |
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
LambdaDeploymentConfigName(scope, id, lambdaDeploymentConfigName)
static frompublic static fromLambdaDeploymentConfigName(scope: Construct, id: string, lambdaDeploymentConfigName: string): ILambdaDeploymentConfig
Parameters
- scope
Construct
— the parent Construct for this new Construct. - id
string
— the logical ID of this new Construct. - lambdaDeploymentConfigName
string
— the name of the Lambda Deployment Configuration to import.
Returns
Import a Deployment Configuration for a Lambda Deployment Group defined outside the CDK.
static import(_scope, _id, props)
public static import(_scope: Construct, _id: string, props: LambdaDeploymentConfigImportProps): ILambdaDeploymentConfig
⚠️ Deprecated: use fromLambdaDeploymentConfigName
Parameters
- _scope
Construct
— the parent Construct for this new Construct. - _id
string
— the logical ID of this new Construct. - props
Lambda
— the properties of the referenced custom Deployment Configuration.Deployment Config Import Props
Returns
Import a Deployment Configuration for a Lambda Deployment Group defined outside the CDK.