Class: AWSCDK::CfnUpdatePolicy

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cfn_update_policy.rb

Overview

Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource.

AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auto_scaling_replacing_update: nil, auto_scaling_rolling_update: nil, auto_scaling_scheduled_action: nil, code_deploy_lambda_alias_update: nil, enable_version_upgrade: nil, use_online_resharding: nil) ⇒ CfnUpdatePolicy

Returns a new instance of CfnUpdatePolicy.

Parameters:

  • auto_scaling_replacing_update (AWSCDK::CfnAutoScalingReplacingUpdate, nil) (defaults to: nil)

    Specifies whether an Auto Scaling group and the instances it contains are replaced during an update.

  • auto_scaling_rolling_update (AWSCDK::CfnAutoScalingRollingUpdate, nil) (defaults to: nil)

    To specify how AWS CloudFormation handles rolling updates for an Auto Scaling group, use the AutoScalingRollingUpdate policy.

  • auto_scaling_scheduled_action (AWSCDK::CfnAutoScalingScheduledAction, nil) (defaults to: nil)

    To specify how AWS CloudFormation handles updates for the MinSize, MaxSize, and DesiredCapacity properties when the AWS::AutoScaling::AutoScalingGroup resource has an associated scheduled action, use the AutoScalingScheduledAction policy.

  • code_deploy_lambda_alias_update (AWSCDK::CfnCodeDeployLambdaAliasUpdate, nil) (defaults to: nil)

    To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy.

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

    To upgrade an Amazon ES domain to a new version of Elasticsearch rather than replacing the entire AWS::Elasticsearch::Domain resource, use the EnableVersionUpgrade update policy.

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

    To modify a replication group's shards by adding or removing shards, rather than replacing the entire AWS::ElastiCache::ReplicationGroup resource, use the UseOnlineResharding update policy.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'cfn_update_policy.rb', line 16

def initialize(auto_scaling_replacing_update: nil, auto_scaling_rolling_update: nil, auto_scaling_scheduled_action: nil, code_deploy_lambda_alias_update: nil, enable_version_upgrade: nil, use_online_resharding: nil)
  @auto_scaling_replacing_update = auto_scaling_replacing_update.is_a?(Hash) ? ::AWSCDK::CfnAutoScalingReplacingUpdate.new(**auto_scaling_replacing_update.transform_keys(&:to_sym)) : auto_scaling_replacing_update
  Jsii::Type.check_type(@auto_scaling_replacing_update, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5BdXRvU2NhbGluZ1JlcGxhY2luZ1VwZGF0ZSJ9")), "autoScalingReplacingUpdate") unless @auto_scaling_replacing_update.nil?
  @auto_scaling_rolling_update = auto_scaling_rolling_update.is_a?(Hash) ? ::AWSCDK::CfnAutoScalingRollingUpdate.new(**auto_scaling_rolling_update.transform_keys(&:to_sym)) : auto_scaling_rolling_update
  Jsii::Type.check_type(@auto_scaling_rolling_update, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5BdXRvU2NhbGluZ1JvbGxpbmdVcGRhdGUifQ==")), "autoScalingRollingUpdate") unless @auto_scaling_rolling_update.nil?
  @auto_scaling_scheduled_action = auto_scaling_scheduled_action.is_a?(Hash) ? ::AWSCDK::CfnAutoScalingScheduledAction.new(**auto_scaling_scheduled_action.transform_keys(&:to_sym)) : auto_scaling_scheduled_action
  Jsii::Type.check_type(@auto_scaling_scheduled_action, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5BdXRvU2NhbGluZ1NjaGVkdWxlZEFjdGlvbiJ9")), "autoScalingScheduledAction") unless @auto_scaling_scheduled_action.nil?
  @code_deploy_lambda_alias_update = code_deploy_lambda_alias_update.is_a?(Hash) ? ::AWSCDK::CfnCodeDeployLambdaAliasUpdate.new(**code_deploy_lambda_alias_update.transform_keys(&:to_sym)) : code_deploy_lambda_alias_update
  Jsii::Type.check_type(@code_deploy_lambda_alias_update, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DZm5Db2RlRGVwbG95TGFtYmRhQWxpYXNVcGRhdGUifQ==")), "codeDeployLambdaAliasUpdate") unless @code_deploy_lambda_alias_update.nil?
  @enable_version_upgrade = enable_version_upgrade
  Jsii::Type.check_type(@enable_version_upgrade, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableVersionUpgrade") unless @enable_version_upgrade.nil?
  @use_online_resharding = use_online_resharding
  Jsii::Type.check_type(@use_online_resharding, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "useOnlineResharding") unless @use_online_resharding.nil?
end

Instance Attribute Details

#auto_scaling_replacing_updateAWSCDK::CfnAutoScalingReplacingUpdate? (readonly)

Specifies whether an Auto Scaling group and the instances it contains are replaced during an update.

During replacement, AWS CloudFormation retains the old group until it finishes creating the new one. If the update fails, AWS CloudFormation can roll back to the old Auto Scaling group and delete the new Auto Scaling group.



38
39
40
# File 'cfn_update_policy.rb', line 38

def auto_scaling_replacing_update
  @auto_scaling_replacing_update
end

#auto_scaling_rolling_updateAWSCDK::CfnAutoScalingRollingUpdate? (readonly)

To specify how AWS CloudFormation handles rolling updates for an Auto Scaling group, use the AutoScalingRollingUpdate policy.

Rolling updates enable you to specify whether AWS CloudFormation updates instances that are in an Auto Scaling group in batches or all at once.



45
46
47
# File 'cfn_update_policy.rb', line 45

def auto_scaling_rolling_update
  @auto_scaling_rolling_update
end

#auto_scaling_scheduled_actionAWSCDK::CfnAutoScalingScheduledAction? (readonly)

To specify how AWS CloudFormation handles updates for the MinSize, MaxSize, and DesiredCapacity properties when the AWS::AutoScaling::AutoScalingGroup resource has an associated scheduled action, use the AutoScalingScheduledAction policy.



49
50
51
# File 'cfn_update_policy.rb', line 49

def auto_scaling_scheduled_action
  @auto_scaling_scheduled_action
end

#code_deploy_lambda_alias_updateAWSCDK::CfnCodeDeployLambdaAliasUpdate? (readonly)

To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy.



53
54
55
# File 'cfn_update_policy.rb', line 53

def code_deploy_lambda_alias_update
  @code_deploy_lambda_alias_update
end

#enable_version_upgradeBoolean? (readonly)

To upgrade an Amazon ES domain to a new version of Elasticsearch rather than replacing the entire AWS::Elasticsearch::Domain resource, use the EnableVersionUpgrade update policy.

Returns:

  • (Boolean, nil)


57
58
59
# File 'cfn_update_policy.rb', line 57

def enable_version_upgrade
  @enable_version_upgrade
end

#use_online_reshardingBoolean? (readonly)

To modify a replication group's shards by adding or removing shards, rather than replacing the entire AWS::ElastiCache::ReplicationGroup resource, use the UseOnlineResharding update policy.

Returns:

  • (Boolean, nil)


61
62
63
# File 'cfn_update_policy.rb', line 61

def use_online_resharding
  @use_online_resharding
end

Class Method Details

.jsii_propertiesObject



63
64
65
66
67
68
69
70
71
72
# File 'cfn_update_policy.rb', line 63

def self.jsii_properties
  {
    :auto_scaling_replacing_update => "autoScalingReplacingUpdate",
    :auto_scaling_rolling_update => "autoScalingRollingUpdate",
    :auto_scaling_scheduled_action => "autoScalingScheduledAction",
    :code_deploy_lambda_alias_update => "codeDeployLambdaAliasUpdate",
    :enable_version_upgrade => "enableVersionUpgrade",
    :use_online_resharding => "useOnlineResharding",
  }
end

Instance Method Details

#to_jsiiObject



74
75
76
77
78
79
80
81
82
83
84
85
# File 'cfn_update_policy.rb', line 74

def to_jsii
  result = {}
  result.merge!({
    "autoScalingReplacingUpdate" => @auto_scaling_replacing_update,
    "autoScalingRollingUpdate" => @auto_scaling_rolling_update,
    "autoScalingScheduledAction" => @auto_scaling_scheduled_action,
    "codeDeployLambdaAliasUpdate" => @code_deploy_lambda_alias_update,
    "enableVersionUpgrade" => @enable_version_upgrade,
    "useOnlineResharding" => @use_online_resharding,
  })
  result.compact
end