Class: CFnDK::ChangeSetCommand
- Inherits:
-
Thor
- Object
- Thor
- CFnDK::ChangeSetCommand
- Defined in:
- lib/cfndk/change_set_command.rb
Instance Method Summary collapse
Methods included from SubcommandHelpReturnable
Methods included from SubcommandHelpReturnable::ClassMethods
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cfndk/change_set_command.rb', line 16 def create CFnDK.logger.info 'create...'.color(:green) data = load_config_data() credentials = resolve_credential(data, ) global_config = CFnDK::GlobalConfig.new(data, ) stacks = CFnDK::Stacks.new(data, , credentials) global_config.pre_command_execute stacks.pre_command_execute stacks.validate stacks.create_change_set stacks.post_command_execute global_config.post_command_execute return 0 rescue => e CFnDK.logger.error "#{e.class}: #{e.}".color(:red) e.backtrace_locations.each do |line| CFnDK.logger.debug line end return 1 end |
#destroy ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/cfndk/change_set_command.rb', line 61 def destroy CFnDK.logger.info 'destroy...'.color(:green) data = load_config_data() credentials = resolve_credential(data, ) stacks = CFnDK::Stacks.new(data, , credentials) if [:force] || yes?('Are you sure you want to destroy? (y/n)', :yellow) stacks.delete_change_set return 0 else CFnDK.logger.info 'destroy command was canceled'.color(:green) return 2 end rescue => e CFnDK.logger.error "#{e.class}: #{e.}".color(:red) e.backtrace_locations.each do |line| CFnDK.logger.debug line end return 1 end |
#execute ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/cfndk/change_set_command.rb', line 41 def execute CFnDK.logger.info 'execute...'.color(:green) data = load_config_data() credentials = resolve_credential(data, ) stacks = CFnDK::Stacks.new(data, , credentials) stacks.execute_change_set return 0 rescue => e CFnDK.logger.error "#{e.class}: #{e.}".color(:red) e.backtrace_locations.each do |line| CFnDK.logger.debug line end return 1 end |
#report ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/cfndk/change_set_command.rb', line 87 def report CFnDK.logger.info 'report...'.color(:green) data = load_config_data() credentials = resolve_credential(data, ) stacks = CFnDK::Stacks.new(data, , credentials) stacks.report_change_set return 0 rescue => e CFnDK.logger.error "#{e.class}: #{e.}".color(:red) e.backtrace_locations.each do |line| CFnDK.logger.debug line end return 1 end |