Class: Jets::Cfn::Resource::Nested::OneController

Inherits:
Base
  • Object
show all
Defined in:
lib/jets/cfn/resource/nested/one_controller.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #template_url

Methods inherited from Base

#attributes, #logical_id, #permission, #properties, #replacements, #replacer, #standarize, #template, truncate_id, #type

Methods included from Util::Camelize

#camelize

Constructor Details

This class inherits a constructor from Jets::Cfn::Resource::Nested::Base

Instance Method Details

#authorizer_output(desc) ⇒ Object



38
39
40
41
42
# File 'lib/jets/cfn/resource/nested/one_controller.rb', line 38

def authorizer_output(desc)
  authorizer_stack, authorizer_logical_id = desc.split('.')
  # IE: MainAuthorizer.Outputs.ProtectAuthorizer
  "#{authorizer_stack}.Outputs.#{authorizer_logical_id}"
end

#controller_paramsObject



28
29
30
31
32
33
34
35
36
# File 'lib/jets/cfn/resource/nested/one_controller.rb', line 28

def controller_params
  if Jets::Router.no_routes?
    {}
  else
    {
      RestApi: "!GetAtt ApiGateway.Outputs.RestApi",
    }
  end
end

#definitionObject

interface method



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/jets/cfn/resource/nested/one_controller.rb', line 4

def definition
  defintion = {
    JetsController: {
      Type: "AWS::CloudFormation::Stack",
      Properties: {
        TemplateURL: template_url,
        Parameters: parameters,
      }
    }
  }
  defintion
end

#outputsObject



44
45
46
# File 'lib/jets/cfn/resource/nested/one_controller.rb', line 44

def outputs
  {}
end

#parametersObject



22
23
24
25
26
# File 'lib/jets/cfn/resource/nested/one_controller.rb', line 22

def parameters
  params = Jets::Cfn::Params::Common.parameters
  params.merge!(controller_params)
  params
end

#template_filenameObject

override



18
19
20
# File 'lib/jets/cfn/resource/nested/one_controller.rb', line 18

def template_filename
  "jets-controller.yml"
end