Class: Jets::Resource::ChildStack::ApiGateway

Inherits:
Base
  • Object
show all
Defined in:
lib/jets/resource/child_stack/api_gateway.rb

Instance Method Summary collapse

Methods inherited from Base

#replacements, #resource

Constructor Details

#initialize(s3_bucket) ⇒ ApiGateway

Returns a new instance of ApiGateway.



3
4
5
# File 'lib/jets/resource/child_stack/api_gateway.rb', line 3

def initialize(s3_bucket)
  @s3_bucket = s3_bucket
end

Instance Method Details

#definitionObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/jets/resource/child_stack/api_gateway.rb', line 7

def definition
  {
    api_gateway: {
      type: "AWS::CloudFormation::Stack",
      properties: {
        template_url: template_url,
      }
    }
  }
end

#outputsObject



18
19
20
21
22
# File 'lib/jets/resource/child_stack/api_gateway.rb', line 18

def outputs
  {
    logical_id => "!Ref #{logical_id}",
  }
end

#template_urlObject



24
25
26
27
# File 'lib/jets/resource/child_stack/api_gateway.rb', line 24

def template_url
  path = File.basename("#{Jets.config.project_namespace}-api-gateway.yml")
  "https://s3.amazonaws.com/#{@s3_bucket}/jets/cfn-templates/#{path}"
end