Sha256: 7dc6c0bb09d4264cbf4539ec12cb4b473ff0be7d9b5050b2a7c51c605e5f76fe

Contents?: true

Size: 1.51 KB

Versions: 185

Compression:

Stored size: 1.51 KB

Contents

# CloudFormation Docs AWS::ApiGateway::DomainName: https://amzn.to/2BsrSqo
#
# Example:
#
#   Type: AWS::ApiGateway::BasePathMapping
#   Properties:
#     BasePath: String
#     DomainName: String
#     RestApiId: String
#     Stage: String
#
# Currently unable to add base path mapping in-place with CloudFormation.
# The workaround for this is to do it post deployment with raw API calls outside
# of CloudFormation.  Leaving this around for now in case there's a workaround
# to get this into CloudFormation instead of raw API calls. Some notes:
#   * Also tried to change the domain name of to something like demo-dev-[random].mydomain.com
#   That does not work because the domain name has to match the route53 record exactly.
#
module Jets::Resource::ApiGateway::BasePath
  class Mapping < Jets::Resource::Base
    def definition
      function_logical_id = "BasePathFunction" # lambda function that supports custom resource
      {
        base_path_mapping: {
          type: "Custom::BasePathMapping",
          properties: {
            service_token: "!GetAtt #{function_logical_id}.Arn",
            # base_path: '', # empty path represents root
            # domain_name: "!Ref DomainName",
            # rest_api_id: "!Ref RestApi", # since this is in the Deployment template
            # stage: Deployment.stage_name,
          },
          depends_on: Jets::Resource::ApiGateway::Deployment.logical_id,
        }
      }
    end

    def outputs
      {
        "BasePathMapping" => "!Ref BasePathMapping",
      }
    end
  end
end

Version data entries

185 entries across 185 versions & 4 rubygems

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