aws / serverless-application-model

The AWS Serverless Application Model (AWS SAM) transform is a AWS CloudFormation macro that transforms SAM templates into CloudFormation templates.
https://aws.amazon.com/serverless/sam
Apache License 2.0
9.36k stars 2.38k forks source link

Custom Domains: Enable adding basepath mappings in Domain property #1131

Open praneetap opened 5 years ago

praneetap commented 5 years ago

Related Issues

783

Description

Custom Domains Milestone 3 is to enable multiple domains to multiple Apis mapping. The task tracks adding specific basepath mappings.

SAM input

  Type: AWS::Serverless::Api
  Properties:
    Domain:
    - DomainName: example.com
      Certificate: !Ref MyApiExampleDomainCertificate 
      BasePathMappings: 
          - BasePath: somepath # BasePath takes a string, or a list of strings. Required value. 
            Api: !Ref MyFirstApi  # Default: !Ref MyApiAdvancedDomain; use case: mapping this domain to additional APIs
            Stage: ''  # Default: {MyApi.Stage} Defaults to the current Api's stage
    - DomainName: another.com
      BasePathMappings:
          - BasePath: [anotherpath, andanother] 
            Api: !Ref MySecondApi  # Default: !Ref MyApiAdvancedDomain; use case: mapping this domain to additional APIs
            Stage: !Ref MySecondApi.Stage  # Default: {MyApi.Stage} Defaults to the current Api's stage
      Certificate: !Ref MyApiAnotherDomainCertificate 
      EndpointConfiguration: REGIONAL # this is default, so same as not having this here
jfuss commented 3 years ago

Updating Labels.

To the community: We use Github reactions to help us in prioritizing feature work. If this is useful to you, please add a +1 reaction (not comment).

babaMar commented 2 years ago

Would the above work for domains in different hosted zones?