Class: Cody::CLI::Delete
- Inherits:
-
Object
- Object
- Cody::CLI::Delete
- Includes:
- AwsServices
- Defined in:
- lib/cody/cli/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?, #find_stack, #inferred_project_name, #inferred_stack_name, #normalize_stack_name, #project_name_convention, #stack_exists?
Constructor Details
#initialize(options) ⇒ Delete
Returns a new instance of Delete.
5 6 7 8 9 |
# File 'lib/cody/cli/delete.rb', line 5 def initialize() @options = @project_name = [:project_name] || inferred_project_name @stack_name = normalize_stack_name([:stack_name] || inferred_stack_name(@project_name)) end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cody/cli/delete.rb', line 11 def run = "Deleted #{@stack_name} stack." if @options[:noop] puts "NOOP #{}" 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 |