Class: Jets::Resource::ChildStack::ApiGateway
- Defined in:
- lib/jets/resource/child_stack/api_gateway.rb
Instance Method Summary collapse
- #definition ⇒ Object
-
#initialize(s3_bucket, options = {}) ⇒ ApiGateway
constructor
A new instance of ApiGateway.
- #outputs ⇒ Object
- #parameters ⇒ Object
- #template_filename ⇒ Object
Methods inherited from Base
Methods inherited from Base
Constructor Details
#initialize(s3_bucket, options = {}) ⇒ ApiGateway
Returns a new instance of ApiGateway.
8 9 10 11 12 13 |
# File 'lib/jets/resource/child_stack/api_gateway.rb', line 8 def initialize(s3_bucket, ={}) super @page = [:page] @page_range = [:page_range] @required_parameters = [:required_parameters] end |
Instance Method Details
#definition ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/jets/resource/child_stack/api_gateway.rb', line 15 def definition properties = { template_url: template_url, } properties["parameters"] = parameters unless @page == 0 Hash["api_gateway_#{@page}" => { type: "AWS::CloudFormation::Stack", properties: properties }] end |
#outputs ⇒ Object
43 44 45 46 47 |
# File 'lib/jets/resource/child_stack/api_gateway.rb', line 43 def outputs { logical_id => "!Ref #{logical_id}", } end |
#parameters ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/jets/resource/child_stack/api_gateway.rb', line 30 def parameters p = { RestApi: "!GetAtt ApiGateway0.Outputs.RestApi", RootResourceId: "!GetAtt ApiGateway0.Outputs.RootResourceId", } @required_parameters.each do |required_parameter| p[required_parameter[:logical_id]] = "!GetAtt #{required_parameter[:location]}" end unless @required_parameters.nil? p end |