Show / Hide Table of Contents

Class AutoRollbackConfig

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

Inheritance
object
AutoRollbackConfig
Implements
IAutoRollbackConfig
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.CodeDeploy
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AutoRollbackConfig : IAutoRollbackConfig
Syntax (vb)
Public Class AutoRollbackConfig 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,
                // 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
                },
                // whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group
                // default: false
                TerminationHook = true
            });

Synopsis

Constructors

AutoRollbackConfig()

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

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()

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

public AutoRollbackConfig()
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
                },
                // whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group
                // default: false
                TerminationHook = true
            });

Properties

DeploymentInAlarm

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

public bool? DeploymentInAlarm { get; set; }
Property Value

bool?

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 bool? FailedDeployment { get; set; }
Property Value

bool?

Remarks

Default: true

StoppedDeployment

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

public bool? StoppedDeployment { get; set; }
Property Value

bool?

Remarks

Default: false

Implements

IAutoRollbackConfig
Back to top Generated by DocFX