Class: Jets::Cfn::Delete

Inherits:
Stack
  • Object
show all
Defined in:
lib/jets/cfn/delete.rb

Instance Method Summary collapse

Methods inherited from Stack

#check_stack_exist!, #initialize, #stack_name

Methods included from Stack::Deployable

#check_deployable!

Methods included from Stack::Rollback

#continue_update_rollback!, #delete_rollback_complete!, #rollback_complete?, #update_rollback_failed?

Methods included from Util::Logging

#log

Methods included from AwsServices::AwsHelpers

#find_stack

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!

Constructor Details

This class inherits a constructor from Jets::Cfn::Stack

Instance Method Details

#bootstrap_if_neededObject

In case user has deleted stack already and needs to delete the Jets API deployment record.



10
11
12
13
14
15
# File 'lib/jets/cfn/delete.rb', line 10

def bootstrap_if_needed
  stack_name = Jets.project.namespace
  return if stack_exists?(stack_name)
  log.info "Creating dummy stack for deletion: #{stack_name}"
  Jets::Cfn::Bootstrap.new(@options).run
end

#runObject



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

def run
  bootstrap_if_needed
  Jets::Remote::Runner.new(@options.merge(dummy: true, command: "delete")).run
  Teardown.new(@options).run
end