Class: Humidifier::AwsAdapters::SDKV2
- Defined in:
- lib/humidifier/aws_adapters/sdkv2.rb
Overview
The adapter for v2 of aws-sdk
Direct Known Subclasses
Instance Method Summary collapse
-
#create_change_set(payload) ⇒ Object
Create a change set in CFN.
-
#deploy_change_set(payload) ⇒ Object
Create a change set if the stack exists, otherwise create the stack.
-
#exists?(payload) ⇒ Boolean
True if the stack exists in CFN.
Methods inherited from Base
#create, #delete, #deploy, #update, #upload, #valid?
Instance Method Details
#create_change_set(payload) ⇒ Object
Create a change set in CFN
6 7 8 9 |
# File 'lib/humidifier/aws_adapters/sdkv2.rb', line 6 def create_change_set(payload) payload.merge(change_set_name: "changeset-#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}") try_valid { client.create_change_set(payload.create_change_set_params) } end |
#deploy_change_set(payload) ⇒ Object
Create a change set if the stack exists, otherwise create the stack
12 13 14 |
# File 'lib/humidifier/aws_adapters/sdkv2.rb', line 12 def deploy_change_set(payload) exists?(payload) ? create_change_set(payload) : create(payload) end |
#exists?(payload) ⇒ Boolean
True if the stack exists in CFN
17 18 19 |
# File 'lib/humidifier/aws_adapters/sdkv2.rb', line 17 def exists?(payload) base_module::CloudFormation::Stack.new(name: payload.identifier).exists? end |