Class: Pipedream::Delete
- Inherits:
-
Object
- Object
- Pipedream::Delete
- Includes:
- AwsServices
- Defined in:
- lib/pipedream/delete.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Delete
constructor
A new instance of Delete.
- #run ⇒ Object
Methods included from AwsServices
Methods included from AwsServices::Helpers
#are_you_sure?, #inferred_pipeline_name, #inferred_stack_name, #pipeline_name_convention, #stack_exists?
Constructor Details
#initialize(options) ⇒ Delete
Returns a new instance of Delete.
5 6 7 8 9 |
# File 'lib/pipedream/delete.rb', line 5 def initialize() = @pipeline_name = [:pipeline_name] || inferred_pipeline_name @stack_name = [:stack_name] || inferred_stack_name(@pipeline_name) end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pipedream/delete.rb', line 11 def run = "Deleted #{@stack_name} stack." if [:noop] puts "NOOP #{message}" else are_you_sure?(@stack_name, :delete) if stack_exists?(@stack_name) cfn.delete_stack(stack_name: @stack_name) puts else puts "#{@stack_name.inspect} stack does not exist".color(:red) end end end |