Interface IAutoRollbackConfig
The configuration for automatically rolling back deployments in a given Deployment Group.
Namespace: Amazon.CDK.AWS.CodeDeploy
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IAutoRollbackConfig
Syntax (vb)
Public Interface IAutoRollbackConfig
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.AutoScaling;
using Amazon.CDK.AWS.CloudWatch;
ServerApplication application;
AutoScalingGroup asg;
Alarm alarm;
var deploymentGroup = new ServerDeploymentGroup(this, "CodeDeployDeploymentGroup", new ServerDeploymentGroupProps {
Application = application,
DeploymentGroupName = "MyDeploymentGroup",
AutoScalingGroups = new [] { 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 InstanceTagSet(new Dictionary<string, string[]> {
// any instance with tags satisfying
// key1=v1 or key1=v2 or key2 (any value) or value v3 (any key)
// will match this group
{ "key1", new [] { "v1", "v2" } },
{ "key2", new [] { } },
{ "", new [] { "v3" } }
}),
// adds on-premise instances matching tags
OnPremiseInstanceTags = new InstanceTagSet(new Dictionary<string, string[]> {
{ "key1", new [] { "v1", "v2" } }
}, new Dictionary<string, string[]> {
{ "key2", new [] { "v3" } }
}),
// CloudWatch alarms
Alarms = new [] { 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 = new AutoRollbackConfig {
FailedDeployment = true, // default: true
StoppedDeployment = true, // default: false
DeploymentInAlarm = true
}
});
Synopsis
Properties
DeploymentInAlarm | Whether to automatically roll back a deployment during which one of the configured CloudWatch alarms for this Deployment Group went off. |
FailedDeployment | Whether to automatically roll back a deployment that fails. |
StoppedDeployment | Whether to automatically roll back a deployment that was manually stopped. |
Properties
DeploymentInAlarm
Whether to automatically roll back a deployment during which one of the configured CloudWatch alarms for this Deployment Group went off.
virtual Nullable<bool> DeploymentInAlarm { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true if you've provided any Alarms with the alarms
property, false otherwise
FailedDeployment
Whether to automatically roll back a deployment that fails.
virtual Nullable<bool> FailedDeployment { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
StoppedDeployment
Whether to automatically roll back a deployment that was manually stopped.
virtual Nullable<bool> StoppedDeployment { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false