Sha256: 96a4324d179494acccf423f6091d3cada9bfa62d2d1af86f434abc64ac6196bd

Contents?: true

Size: 948 Bytes

Versions: 15

Compression:

Stored size: 948 Bytes

Contents

module Jets::Cfn::Params::Api
  class Resources < Base
    # interface method
    def build
      # For the nested ApiResources template defined in the parent template, we need
      # grab the parameters from the other paged ApiResources templates if not in
      # the current template.
      @template[:Parameters].keys.each do |key|
        key = key.to_sym
        case key.to_s
        when "RestApi"
          @params.merge!(key => "!GetAtt ApiGateway.Outputs.RestApi")
        when "RootResourceId"
          @params.merge!(key => "!GetAtt ApiGateway.Outputs.RootResourceId")
        else
          @params.merge!(key => "!GetAtt #{self.class.stack_logical_id(key)}.Outputs.#{key}")
        end
      end
    end

    class << self
      # IE: path: #{Jets.build_root}/templates/api-resources-1.yml"
      def stack_logical_id(parameter)
        Jets::Cfn::Template.lookup_logical_id("api-resources", parameter)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
jets-5.0.13 lib/jets/cfn/params/api/resources.rb
jets-5.0.12 lib/jets/cfn/params/api/resources.rb
jets-5.0.11 lib/jets/cfn/params/api/resources.rb
jets-5.0.10 lib/jets/cfn/params/api/resources.rb
jets-5.0.9 lib/jets/cfn/params/api/resources.rb
jets-5.0.8 lib/jets/cfn/params/api/resources.rb
jets-5.0.7 lib/jets/cfn/params/api/resources.rb
jets-5.0.6 lib/jets/cfn/params/api/resources.rb
jets-5.0.5 lib/jets/cfn/params/api/resources.rb
jets-5.0.4 lib/jets/cfn/params/api/resources.rb
jets-5.0.3 lib/jets/cfn/params/api/resources.rb
jets-5.0.2 lib/jets/cfn/params/api/resources.rb
jets-5.0.1 lib/jets/cfn/params/api/resources.rb
jets-5.0.0 lib/jets/cfn/params/api/resources.rb
jets-5.0.0.beta1 lib/jets/cfn/params/api/resources.rb