Class: Humidifier::SdkPayload
- Inherits:
-
Object
- Object
- Humidifier::SdkPayload
- Extended by:
- Forwardable
- Defined in:
- lib/humidifier/sdk_payload.rb
Overview
The payload sent to the shim methods, representing the stack and the options
Defined Under Namespace
Classes: TemplateTooLargeError
Constant Summary collapse
- MAX_TEMPLATE_BODY_SIZE =
The maximum size a template body can be before it has to be put somewhere and referenced through a URL
51_200
- MAX_TEMPLATE_URL_SIZE =
The maximum size a template body can be inside of an S3 bucket
460_800
- MAX_WAIT =
The maximum amount of time that Humidifier should wait for a stack to complete a CRUD operation
600
Instance Attribute Summary collapse
-
#force_upload ⇒ Object
Force the stack to upload to S3 regardless of the size of the stack.
-
#max_wait ⇒ Object
The maximum amount of time that ‘humidifier` should wait for the stack to resolve to the desired state.
-
#options ⇒ Object
readonly
Options that should be passed through to CloudFormation when the desired operation is being performed.
-
#stack ⇒ Object
readonly
The stack on which operations are going to be performed.
Instance Method Summary collapse
-
#==(other) ⇒ Object
True if the stack and options are the same as the other (used for testing).
-
#create_change_set_params ⇒ Object
Param set for the #create_change_set SDK method.
-
#create_params ⇒ Object
Param set for the #create_stack SDK method.
-
#delete_params ⇒ Object
Param set for the #delete_stack SDK method.
-
#initialize(stack, options) ⇒ SdkPayload
constructor
A new instance of SdkPayload.
-
#merge(new_options) ⇒ Object
Merge in options.
-
#template_body ⇒ Object
The body of the template.
-
#update_params ⇒ Object
Param set for the #update_stack SDK method.
-
#validate_params ⇒ Object
Param set for the #validate_template SDK method.
Constructor Details
#initialize(stack, options) ⇒ SdkPayload
Returns a new instance of SdkPayload.
46 47 48 49 50 51 |
# File 'lib/humidifier/sdk_payload.rb', line 46 def initialize(stack, ) @stack = stack @options = @max_wait = .delete(:max_wait) || MAX_WAIT @force_upload = .delete(:force_upload) end |
Instance Attribute Details
#force_upload ⇒ Object
Force the stack to upload to S3 regardless of the size of the stack.
41 42 43 |
# File 'lib/humidifier/sdk_payload.rb', line 41 def force_upload @force_upload end |
#max_wait ⇒ Object
The maximum amount of time that ‘humidifier` should wait for the stack to resolve to the desired state. If your stacks are particularly large, you may need to set this to wait longer than the default `MAX_WAIT`.
38 39 40 |
# File 'lib/humidifier/sdk_payload.rb', line 38 def max_wait @max_wait end |
#options ⇒ Object (readonly)
Options that should be passed through to CloudFormation when the desired operation is being performed. Particularly useful for the ‘capabilities` option for acknowledging IAM resource changes.
33 34 35 |
# File 'lib/humidifier/sdk_payload.rb', line 33 def @options end |
#stack ⇒ Object (readonly)
The stack on which operations are going to be performed.
28 29 30 |
# File 'lib/humidifier/sdk_payload.rb', line 28 def stack @stack end |
Instance Method Details
#==(other) ⇒ Object
True if the stack and options are the same as the other (used for testing)
54 55 56 |
# File 'lib/humidifier/sdk_payload.rb', line 54 def ==(other) stack == other.stack && == other. end |
#create_change_set_params ⇒ Object
Param set for the #create_change_set SDK method
73 74 75 |
# File 'lib/humidifier/sdk_payload.rb', line 73 def create_change_set_params { stack_name: stack.identifier }.merge(template_param).merge() end |
#create_params ⇒ Object
Param set for the #create_stack SDK method
78 79 80 |
# File 'lib/humidifier/sdk_payload.rb', line 78 def create_params { stack_name: stack.name }.merge(template_param).merge() end |
#delete_params ⇒ Object
Param set for the #delete_stack SDK method
83 84 85 |
# File 'lib/humidifier/sdk_payload.rb', line 83 def delete_params { stack_name: stack.identifier }.merge() end |
#merge(new_options) ⇒ Object
Merge in options
59 60 61 |
# File 'lib/humidifier/sdk_payload.rb', line 59 def merge() @options = .merge() end |
#template_body ⇒ Object
The body of the template
64 65 66 |
# File 'lib/humidifier/sdk_payload.rb', line 64 def template_body @template_body ||= stack.to_cf end |
#update_params ⇒ Object
Param set for the #update_stack SDK method
88 89 90 |
# File 'lib/humidifier/sdk_payload.rb', line 88 def update_params { stack_name: stack.identifier }.merge(template_param).merge() end |
#validate_params ⇒ Object
Param set for the #validate_template SDK method
93 94 95 |
# File 'lib/humidifier/sdk_payload.rb', line 93 def validate_params template_param.merge() end |