Class: Jets::Cfn::Teardown

Inherits:
Stack
  • Object
show all
Defined in:
lib/jets/cfn/teardown.rb,
lib/jets/cfn/teardown/bucket.rb

Defined Under Namespace

Classes: Bucket

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

#remaining_resourcesObject



10
11
12
13
14
15
16
17
18
# File 'lib/jets/cfn/teardown.rb', line 10

def remaining_resources
  stack_resources = cfn.describe_stack_resources(stack_name: stack_name).stack_resources
  resources = stack_resources.map(&:logical_resource_id).join(", ")
  log.debug "Remaining resources: #{resources}"
  log.debug "Final delete #{Jets.project.namespace.color(:green)}"
  cfn.delete_stack(stack_name: stack_name)
  cfn_status = Jets::Cfn::Status.new
  cfn_status.wait
end

#runObject



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

def run
  check_stack_exist!
  log.info "Final Delete Phase"
  Bucket.new.empty!
  remaining_resources
end