Class: AWSCDK::Autoscaling::ApplyCloudFormationInitOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Autoscaling::ApplyCloudFormationInitOptions
- Defined in:
- autoscaling/apply_cloud_formation_init_options.rb
Overview
Options for applying CloudFormation init to an instance or instance group.
Instance Attribute Summary collapse
-
#config_sets ⇒ Array<String>?
readonly
ConfigSet to activate.
-
#embed_fingerprint ⇒ Boolean?
readonly
Force instance replacement by embedding a config fingerprint.
-
#ignore_failures ⇒ Boolean?
readonly
Don't fail the instance creation when cfn-init fails.
-
#include_role ⇒ Boolean?
readonly
Include --role argument when running cfn-init and cfn-signal commands.
-
#include_url ⇒ Boolean?
readonly
Include --url argument when running cfn-init and cfn-signal commands.
-
#print_log ⇒ Boolean?
readonly
Print the results of running cfn-init to the Instance System Log.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config_sets: nil, embed_fingerprint: nil, ignore_failures: nil, include_role: nil, include_url: nil, print_log: nil) ⇒ ApplyCloudFormationInitOptions
constructor
A new instance of ApplyCloudFormationInitOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(config_sets: nil, embed_fingerprint: nil, ignore_failures: nil, include_role: nil, include_url: nil, print_log: nil) ⇒ ApplyCloudFormationInitOptions
Returns a new instance of ApplyCloudFormationInitOptions.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'autoscaling/apply_cloud_formation_init_options.rb', line 13 def initialize(config_sets: nil, embed_fingerprint: nil, ignore_failures: nil, include_role: nil, include_url: nil, print_log: nil) @config_sets = config_sets Jsii::Type.check_type(@config_sets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "configSets") unless @config_sets.nil? @embed_fingerprint = Jsii::Type.check_type(@embed_fingerprint, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "embedFingerprint") unless @embed_fingerprint.nil? @ignore_failures = ignore_failures Jsii::Type.check_type(@ignore_failures, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "ignoreFailures") unless @ignore_failures.nil? @include_role = include_role Jsii::Type.check_type(@include_role, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "includeRole") unless @include_role.nil? @include_url = include_url Jsii::Type.check_type(@include_url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "includeUrl") unless @include_url.nil? @print_log = print_log Jsii::Type.check_type(@print_log, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "printLog") unless @print_log.nil? end |
Instance Attribute Details
#config_sets ⇒ Array<String>? (readonly)
Default: ['default']
ConfigSet to activate.
32 33 34 |
# File 'autoscaling/apply_cloud_formation_init_options.rb', line 32 def config_sets @config_sets end |
#embed_fingerprint ⇒ Boolean? (readonly)
Default: true
Force instance replacement by embedding a config fingerprint.
If true (the default), a hash of the config will be embedded into the
UserData, so that if the config changes, the UserData changes and
instances will be replaced (given an UpdatePolicy has been configured on
the AutoScalingGroup).
If false, no such hash will be embedded, and if the CloudFormation Init
config changes nothing will happen to the running instances. If a
config update introduces errors, you will not notice until after the
CloudFormation deployment successfully finishes and the next instance
fails to launch.
48 49 50 |
# File 'autoscaling/apply_cloud_formation_init_options.rb', line 48 def @embed_fingerprint end |
#ignore_failures ⇒ Boolean? (readonly)
Default: false
Don't fail the instance creation when cfn-init fails.
You can use this to prevent CloudFormation from rolling back when instances fail to start up, to help in debugging.
56 57 58 |
# File 'autoscaling/apply_cloud_formation_init_options.rb', line 56 def ignore_failures @ignore_failures end |
#include_role ⇒ Boolean? (readonly)
Default: false
Include --role argument when running cfn-init and cfn-signal commands.
This will be the IAM instance profile attached to the EC2 instance
63 64 65 |
# File 'autoscaling/apply_cloud_formation_init_options.rb', line 63 def include_role @include_role end |
#include_url ⇒ Boolean? (readonly)
Default: false
Include --url argument when running cfn-init and cfn-signal commands.
This will be the cloudformation endpoint in the deployed region e.g. https://cloudformation.us-east-1.amazonaws.com
71 72 73 |
# File 'autoscaling/apply_cloud_formation_init_options.rb', line 71 def include_url @include_url end |
#print_log ⇒ Boolean? (readonly)
Default: true
Print the results of running cfn-init to the Instance System Log.
By default, the output of running cfn-init is written to a log file
on the instance. Set this to true to print it to the System Log
(visible from the EC2 Console), false to not print it.
(Be aware that the system log is refreshed at certain points in time of the instance life cycle, and successful execution may not always show up).
84 85 86 |
# File 'autoscaling/apply_cloud_formation_init_options.rb', line 84 def print_log @print_log end |
Class Method Details
.jsii_properties ⇒ Object
86 87 88 89 90 91 92 93 94 95 |
# File 'autoscaling/apply_cloud_formation_init_options.rb', line 86 def self.jsii_properties { :config_sets => "configSets", :embed_fingerprint => "embedFingerprint", :ignore_failures => "ignoreFailures", :include_role => "includeRole", :include_url => "includeUrl", :print_log => "printLog", } end |
Instance Method Details
#to_jsii ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'autoscaling/apply_cloud_formation_init_options.rb', line 97 def to_jsii result = {} result.merge!({ "configSets" => @config_sets, "embedFingerprint" => @embed_fingerprint, "ignoreFailures" => @ignore_failures, "includeRole" => @include_role, "includeUrl" => @include_url, "printLog" => @print_log, }) result.compact end |