Show / Hide Table of Contents

Class AutoRollbackConfig

The configuration for automatically rolling back deployments in a given Deployment Group.

Inheritance
System.Object
AutoRollbackConfig
Implements
IAutoRollbackConfig
Namespace: Amazon.CDK.AWS.CodeDeploy
Assembly: Amazon.CDK.AWS.CodeDeploy.dll
Syntax (csharp)
public class AutoRollbackConfig : Object, IAutoRollbackConfig
Syntax (vb)
Public Class AutoRollbackConfig
    Inherits Object
    Implements 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,
    // auto-rollback configuration
    AutoRollback = new AutoRollbackConfig {
        FailedDeployment = true,  // default: true
        StoppedDeployment = true,  // default: false
        DeploymentInAlarm = true
    }
});

Synopsis

Constructors

AutoRollbackConfig()

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.

Constructors

AutoRollbackConfig()

public AutoRollbackConfig()

Properties

DeploymentInAlarm

Whether to automatically roll back a deployment during which one of the configured CloudWatch alarms for this Deployment Group went off.

public Nullable<bool> DeploymentInAlarm { get; set; }
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.

public Nullable<bool> FailedDeployment { get; set; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: true

StoppedDeployment

Whether to automatically roll back a deployment that was manually stopped.

public Nullable<bool> StoppedDeployment { get; set; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: false

Implements

IAutoRollbackConfig
Back to top Generated by DocFX