Class: Dynamocli::Erase
- Inherits:
-
Object
- Object
- Dynamocli::Erase
- Defined in:
- lib/dynamocli/erase.rb
Instance Method Summary collapse
-
#initialize(table_name:, with_drift: false) ⇒ Erase
constructor
A new instance of Erase.
- #start ⇒ Object
Constructor Details
#initialize(table_name:, with_drift: false) ⇒ Erase
Returns a new instance of Erase.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/dynamocli/erase.rb', line 12 def initialize(table_name:, with_drift: false) @with_drift = with_drift @table_name = table_name @dynamodb = Aws::DynamoDB::Client.new @cloudformation = Aws::CloudFormation::Client.new @table_on_aws = Aws::DynamoDB::Table.new(@table_name) @stack_resources = @cloudformation.describe_stack_resources(physical_resource_id: @table_name).to_h rescue Aws::CloudFormation::Errors::ValidationError @stack_resources = nil end |
Instance Method Details
#start ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/dynamocli/erase.rb', line 25 def start erase_table rescue Aws::CloudFormation::Errors::ValidationError, Aws::DynamoDB::Errors::ValidationException, Aws::DynamoDB::Errors::ResourceNotFoundException => e LOGGER.error(e.) exit(42) end |