Sha256: e7d253799f421188034e0cd17beafe8226bbb0d1def6d5aa783f8900fdf9e380

Contents?: true

Size: 939 Bytes

Versions: 63

Compression:

Stored size: 939 Bytes

Contents

module Jets::Resource::ChildStack
  class Authorizer < Base
    include CommonParameters

    def initialize(s3_bucket, options={})
      super
      @path = options[:path]
    end

    def definition
      logical_id = authorizer_logical_id
      {
        logical_id => {
          type: "AWS::CloudFormation::Stack",
          properties: {
            template_url: template_url,
            parameters: parameters,
          }
        }
      }
    end

    def parameters
      params = common_parameters
      params[:RestApi] = "!GetAtt ApiGateway.Outputs.RestApi"
      params
    end

    # map the path to a camelized logical_id. IE: ProtectAuthorizer
    def authorizer_logical_id
      regexp = Regexp.new(".*#{Jets.config.project_namespace}-authorizers-")
      authorizer_name = @path.sub(regexp, '').sub('.yml', '')
      authorizer_name.underscore.camelize
    end

    def template_filename
      @path
    end
  end
end

Version data entries

63 entries across 63 versions & 2 rubygems

Version Path
jets-4.0.12 lib/jets/resource/child_stack/authorizer.rb
jets-4.0.11 lib/jets/resource/child_stack/authorizer.rb
jets-4.0.10 lib/jets/resource/child_stack/authorizer.rb
jets-4.0.9 lib/jets/resource/child_stack/authorizer.rb
jets-4.0.8 lib/jets/resource/child_stack/authorizer.rb
jets-4.0.7 lib/jets/resource/child_stack/authorizer.rb
jets-4.0.6 lib/jets/resource/child_stack/authorizer.rb
jets-4.0.5 lib/jets/resource/child_stack/authorizer.rb
jets-4.0.4 lib/jets/resource/child_stack/authorizer.rb
jets-4.0.3 lib/jets/resource/child_stack/authorizer.rb
jets-4.0.2 lib/jets/resource/child_stack/authorizer.rb
jets-4.0.1 lib/jets/resource/child_stack/authorizer.rb
jets-4.0.0 lib/jets/resource/child_stack/authorizer.rb
jets-3.2.2 lib/jets/resource/child_stack/authorizer.rb
jets-3.2.1 lib/jets/resource/child_stack/authorizer.rb
jets.benforeva-3.0.17.pre.mount.pre.fix lib/jets/resource/child_stack/authorizer.rb
jets-3.2.0 lib/jets/resource/child_stack/authorizer.rb
jets-3.1.5 lib/jets/resource/child_stack/authorizer.rb
jets-3.1.4 lib/jets/resource/child_stack/authorizer.rb
jets-3.1.3 lib/jets/resource/child_stack/authorizer.rb