interface AutoRollbackConfig
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CodeDeploy.AutoRollbackConfig |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscodedeploy#AutoRollbackConfig |
![]() | software.amazon.awscdk.services.codedeploy.AutoRollbackConfig |
![]() | aws_cdk.aws_codedeploy.AutoRollbackConfig |
![]() | aws-cdk-lib » aws_codedeploy » AutoRollbackConfig |
The configuration for automatically rolling back deployments in a given Deployment Group.
Example
import * as autoscaling from 'aws-cdk-lib/aws-autoscaling';
import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';
declare const application: codedeploy.ServerApplication;
declare const asg: autoscaling.AutoScalingGroup;
declare const alarm: cloudwatch.Alarm;
const deploymentGroup = new codedeploy.ServerDeploymentGroup(this, 'CodeDeployDeploymentGroup', {
application,
deploymentGroupName: 'MyDeploymentGroup',
autoScalingGroups: [asg],
// adds User Data that installs the CodeDeploy agent on your auto-scaling groups hosts
// default: true
installAgent: true,
// adds EC2 instances matching tags
ec2InstanceTags: new codedeploy.InstanceTagSet(
{
// any instance with tags satisfying
// key1=v1 or key1=v2 or key2 (any value) or value v3 (any key)
// will match this group
'key1': ['v1', 'v2'],
'key2': [],
'': ['v3'],
},
),
// adds on-premise instances matching tags
onPremiseInstanceTags: new codedeploy.InstanceTagSet(
// only instances with tags (key1=v1 or key1=v2) AND key2=v3 will match this set
{
'key1': ['v1', 'v2'],
},
{
'key2': ['v3'],
},
),
// CloudWatch alarms
alarms: [alarm],
// whether to ignore failure to fetch the status of alarms from CloudWatch
// default: false
ignorePollAlarmsFailure: false,
// whether to skip the step of checking CloudWatch alarms during the deployment process
// default: false
ignoreAlarmConfiguration: false,
// auto-rollback configuration
autoRollback: {
failedDeployment: true, // default: true
stoppedDeployment: true, // default: false
deploymentInAlarm: true, // default: true if you provided any alarms, false otherwise
},
// whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group
// default: false
terminationHook: true,
});
Properties
Name | Type | Description |
---|---|---|
deployment | boolean | Whether to automatically roll back a deployment during which one of the configured CloudWatch alarms for this Deployment Group went off. |
failed | boolean | Whether to automatically roll back a deployment that fails. |
stopped | boolean | Whether to automatically roll back a deployment that was manually stopped. |
deploymentInAlarm?
Type:
boolean
(optional, default: true if you've provided any Alarms with the alarms
property, false otherwise)
Whether to automatically roll back a deployment during which one of the configured CloudWatch alarms for this Deployment Group went off.
failedDeployment?
Type:
boolean
(optional, default: true)
Whether to automatically roll back a deployment that fails.
stoppedDeployment?
Type:
boolean
(optional, default: false)
Whether to automatically roll back a deployment that was manually stopped.