Class: Dynamocli::Table::CloudformationTable

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamocli/table/cloudformation_table.rb

Instance Method Summary collapse

Constructor Details

#initialize(table_name:, stack:, cloudformation: nil, logger: nil) ⇒ CloudformationTable

Returns a new instance of CloudformationTable.



8
9
10
11
12
13
# File 'lib/dynamocli/table/cloudformation_table.rb', line 8

def initialize(table_name:, stack:, cloudformation: nil, logger: nil)
  @table_name = table_name
  @stack = stack
  @cloudformation = cloudformation || CLOUDFORMARTION.new
  @logger = logger || LOGGER.new
end

Instance Method Details

#alert_message_before_continueObject



15
16
17
# File 'lib/dynamocli/table/cloudformation_table.rb', line 15

def alert_message_before_continue
  "You're going to deploy and redeploy your #{stack.name} stack to drop and recreate the #{@table_name} table!"
end

#eraseObject



19
20
21
22
23
# File 'lib/dynamocli/table/cloudformation_table.rb', line 19

def erase
  deploy_stack_without_the_table
  wait_for_deployment_to_complete
  deploy_stack_with_the_original_template
end