Module: Jets::Command::AwsHelpers

Extended by:
ActiveSupport::Concern
Includes:
AwsServices
Included in:
Jets::Cfn::Deployment, Base, Delete
Defined in:
lib/jets/command/aws_helpers.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods included from AwsServices

#apigateway, #aws_lambda, #aws_options, #cfn, #dynamodb, #logs, #s3, #s3_resource, #sns, #sqs, #sts

Methods included from AwsServices::StackStatus

#lookup, #stack_exists?, #stack_in_progress?

Methods included from AwsServices::GlobalMemoist

included

Instance Method Details

#find_stack(stack_name) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/jets/command/aws_helpers.rb', line 13

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

#first_run?Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/jets/command/aws_helpers.rb', line 8

def first_run?
  return false if ENV['JETS_TEMPLATES']
  !stack_exists?(Jets::Names.parent_stack_name)
end