Class: Jets::CLI::Delete

Inherits:
Base
  • Object
show all
Defined in:
lib/jets/cli/delete.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #paginate, #paging_params, rescue_api_error

Methods included from Util::Logging

#log

Methods included from AwsServices

#apigateway, #aws_options, #cfn, #codebuild, #dynamodb, #lambda_client, #logs, #s3, #s3_resource, #sns, #sqs, #ssm, #sts, #wafv2

Methods included from AwsServices::StackStatus

#output_value, #stack_exists?

Methods included from AwsServices::GlobalMemoist

included, #reset_cache!

Methods included from Api

#api, #api_key

Constructor Details

This class inherits a constructor from Jets::CLI::Base

Instance Method Details

#are_you_sure?Boolean



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/jets/cli/delete.rb', line 9

def are_you_sure?
  stack_name = Jets.project.namespace
  message = "    Will delete \#{stack_name.color(:green)}\n\n    Uses remote runner to delete the stack and resources.\n  EOL\n  unless stack_exists?(stack_name)\n    message << <<~EOL\n\n      Note: It looks like the stack \#{stack_name} has already been deleted.\n      Jets will create a dummy stack to delete the API deployment record.\n      The dummy stack will be deleted immediately after.\n    EOL\n  end\n  sure?(message)\nend\n"

#runObject



3
4
5
6
7
# File 'lib/jets/cli/delete.rb', line 3

def run
  are_you_sure?
  Jets::Cfn::Bootstrap.new(@options).run
  Jets::Cfn::Delete.new(options).run
end