Method: Jets::Resource::ChildStack::ApiResource#parameters

Defined in:
lib/jets/resource/child_stack/api_resource.rb

#parametersObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/jets/resource/child_stack/api_resource.rb', line 26

def parameters
  params = {}
  # Since dont have all the info required.
  # Read the template back to find the parameters required.
  # Actually might be easier to rationalize this approach.
  template_path = Jets::Naming.api_resources_template_path(@page)
  template = Jets::Cfn::BuiltTemplate.get(template_path)
  template['Parameters'].keys.each do |p|
    case p
    when "RestApi"
      params[p] = "!GetAtt ApiGateway.Outputs.RestApi"
    when "RootResourceId"
      params[p] = "!GetAtt ApiGateway.Outputs.RootResourceId"
    else
      params[p] = "!GetAtt #{api_resource_page(p)}.Outputs.#{p}"
    end
  end
  params
end