Module: Jets::AwsServices::AwsHelpers

Includes:
Jets::AwsServices
Included in:
CLI::Logs, Cfn::Stack::Rollback
Defined in:
lib/jets/aws_services/aws_helpers.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods included from Jets::AwsServices

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

Methods included from StackStatus

#output_value, #stack_exists?

Methods included from GlobalMemoist

included, #reset_cache!

Instance Method Details

#find_stack(stack_name) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/jets/aws_services/aws_helpers.rb', line 5

def find_stack(stack_name)
  resp = cfn.describe_stacks(stack_name: stack_name)
  resp.stacks.first
rescue Aws::CloudFormation::Errors::ValidationError => e
  # example: Stack with id demo-dev does not exist
  if e.message =~ /Stack with/ && e.message =~ /does not exist/
    nil
  else
    raise
  end
end