Class: AWSCDK::CodeDeploy::AutoRollbackConfig

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
code_deploy/auto_rollback_config.rb

Overview

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(deployment_in_alarm: nil, failed_deployment: nil, stopped_deployment: nil) ⇒ AutoRollbackConfig

Returns a new instance of AutoRollbackConfig.

Parameters:

  • deployment_in_alarm (Boolean, nil) (defaults to: nil)

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

  • failed_deployment (Boolean, nil) (defaults to: nil)

    Whether to automatically roll back a deployment that fails.

  • stopped_deployment (Boolean, nil) (defaults to: nil)

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



10
11
12
13
14
15
16
17
# File 'code_deploy/auto_rollback_config.rb', line 10

def initialize(deployment_in_alarm: nil, failed_deployment: nil, stopped_deployment: nil)
  @deployment_in_alarm = deployment_in_alarm
  Jsii::Type.check_type(@deployment_in_alarm, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "deploymentInAlarm") unless @deployment_in_alarm.nil?
  @failed_deployment = failed_deployment
  Jsii::Type.check_type(@failed_deployment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "failedDeployment") unless @failed_deployment.nil?
  @stopped_deployment = stopped_deployment
  Jsii::Type.check_type(@stopped_deployment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "stoppedDeployment") unless @stopped_deployment.nil?
end

Instance Attribute Details

#deployment_in_alarmBoolean? (readonly)

Note:

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.

Returns:

  • (Boolean, nil)


23
24
25
# File 'code_deploy/auto_rollback_config.rb', line 23

def deployment_in_alarm
  @deployment_in_alarm
end

#failed_deploymentBoolean? (readonly)

Note:

Default: true

Whether to automatically roll back a deployment that fails.

Returns:

  • (Boolean, nil)


28
29
30
# File 'code_deploy/auto_rollback_config.rb', line 28

def failed_deployment
  @failed_deployment
end

#stopped_deploymentBoolean? (readonly)

Note:

Default: false

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

Returns:

  • (Boolean, nil)


33
34
35
# File 'code_deploy/auto_rollback_config.rb', line 33

def stopped_deployment
  @stopped_deployment
end

Class Method Details

.jsii_propertiesObject



35
36
37
38
39
40
41
# File 'code_deploy/auto_rollback_config.rb', line 35

def self.jsii_properties
  {
    :deployment_in_alarm => "deploymentInAlarm",
    :failed_deployment => "failedDeployment",
    :stopped_deployment => "stoppedDeployment",
  }
end

Instance Method Details

#to_jsiiObject



43
44
45
46
47
48
49
50
51
# File 'code_deploy/auto_rollback_config.rb', line 43

def to_jsii
  result = {}
  result.merge!({
    "deploymentInAlarm" => @deployment_in_alarm,
    "failedDeployment" => @failed_deployment,
    "stoppedDeployment" => @stopped_deployment,
  })
  result.compact
end