Class: Lono::Cfn::Rollback
- Inherits:
-
Object
- Object
- Lono::Cfn::Rollback
- Extended by:
- Memoist
- Includes:
- AwsServices
- Defined in:
- lib/lono/cfn/rollback.rb
Instance Method Summary collapse
- #delete_stack ⇒ Object
-
#initialize(stack_name) ⇒ Rollback
constructor
A new instance of Rollback.
- #status ⇒ Object
Methods included from AwsServices
#cfn, #ec2, #iam, #s3, #s3_presigner, #s3_resource, #sts
Methods included from AwsServices::Util
#find_stack, #rollback_complete?, #stack_exists?, #testing_update?
Constructor Details
#initialize(stack_name) ⇒ Rollback
Returns a new instance of Rollback.
6 7 8 |
# File 'lib/lono/cfn/rollback.rb', line 6 def initialize(stack_name) @stack_name = stack_name end |
Instance Method Details
#delete_stack ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/lono/cfn/rollback.rb', line 10 def delete_stack stack = find_stack(@stack_name) if stack && rollback_complete?(stack) puts "Existing stack in ROLLBACK_COMPLETE state. Deleting stack before continuing." cfn.delete_stack(stack_name: @stack_name) status.wait status.reset true end end |