Class: Lono::Cfn::Rollback

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Includes:
AwsServices
Defined in:
lib/lono/cfn/rollback.rb

Instance Method Summary collapse

Methods included from AwsServices

#cfn, #ec2, #iam, #s3, #s3_presigner, #s3_resource, #sts

Methods included from AwsServices::Helper

#rollback_complete?, #testing_update?

Methods included from AwsServices::StackSet

#find_stack_set, #stack_set_exists?

Methods included from AwsServices::Stack

#find_stack, #stack_exists?

Constructor Details

#initialize(stack) ⇒ Rollback

Returns a new instance of Rollback.



6
7
8
# File 'lib/lono/cfn/rollback.rb', line 6

def initialize(stack)
  @stack = stack
end

Instance Method Details

#delete_stackObject



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)
  if stack && rollback_complete?(stack)
    puts "Existing stack in ROLLBACK_COMPLETE state. Deleting stack before continuing."
    cfn.delete_stack(stack_name: @stack)
    status.wait
    status.reset
    true
  end
end

#statusObject



21
22
23
# File 'lib/lono/cfn/rollback.rb', line 21

def status
  Lono::Cfn::Status.new(@stack)
end