interface AutoRollbackConfig
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CodeDeploy.AutoRollbackConfig |
Java | software.amazon.awscdk.services.codedeploy.AutoRollbackConfig |
Python | aws_cdk.aws_codedeploy.AutoRollbackConfig |
TypeScript (source) | @aws-cdk/aws-codedeploy » AutoRollbackConfig |
The configuration for automatically rolling back deployments in a given Deployment Group.
Example
import * as autoscaling from '@aws-cdk/aws-autoscaling';
import * as cloudwatch from '@aws-cdk/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,
// auto-rollback configuration
autoRollback: {
failedDeployment: true, // default: true
stoppedDeployment: true, // default: false
deploymentInAlarm: true, // default: true if you provided any alarms, false otherwise
},
});
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.