Class: Jets::Cfn::Resource::Nested::Authorizer
- Defined in:
- lib/jets/cfn/resource/nested/authorizer.rb
Instance Method Summary collapse
-
#authorizer_logical_id ⇒ Object
map the path to a camelized logical_id.
- #definition ⇒ Object
-
#initialize(options = {}) ⇒ Authorizer
constructor
A new instance of Authorizer.
- #parameters ⇒ Object
Methods inherited from Base
#outputs, #template_filename, #template_url
Methods inherited from Base
#attributes, #logical_id, #outputs, #permission, #properties, #replacements, #replacer, #standarize, #template, truncate_id, #type
Methods included from Util::Camelize
Constructor Details
#initialize(options = {}) ⇒ Authorizer
Returns a new instance of Authorizer.
3 4 5 6 |
# File 'lib/jets/cfn/resource/nested/authorizer.rb', line 3 def initialize(={}) super @path = [:path] end |
Instance Method Details
#authorizer_logical_id ⇒ Object
map the path to a camelized logical_id. IE: ProtectAuthorizer
28 29 30 31 32 |
# File 'lib/jets/cfn/resource/nested/authorizer.rb', line 28 def regexp = Regexp.new("#{Jets::Names.templates_folder}/authorizers-") = @path.sub(regexp, '').sub('.yml', '') .underscore.camelize end |
#definition ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/jets/cfn/resource/nested/authorizer.rb', line 8 def definition logical_id = { logical_id => { Type: "AWS::CloudFormation::Stack", Properties: { TemplateURL: template_url, Parameters: parameters, } } } end |
#parameters ⇒ Object
21 22 23 24 25 |
# File 'lib/jets/cfn/resource/nested/authorizer.rb', line 21 def parameters params = Jets::Cfn::Params::Common.parameters params[:RestApi] = "!GetAtt ApiGateway.Outputs.RestApi" params end |