Created
April 24, 2018 15:02
-
-
Save titogeorge/eb54df05dfaa7a69f0a0515ca31d3aea to your computer and use it in GitHub Desktop.
AWS Cloudformation: Custom API Gateway Domain Name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APIRecordSet: | |
Type: AWS::Route53::RecordSet | |
Properties: | |
HostedZoneId: !Ref hosted-zone-id | |
Comment: CNAME Redirect to the API Gateway | |
Name: !Join | |
- "" | |
- [ my-api. , !Ref hosted-zone-name, '.'] | |
Type: CNAME | |
TTL: '300' | |
ResourceRecords: | |
- !GetAtt ApiGwCustomDomainName.DistributionDomainName | |
ApiGwCustomDomainName: | |
Type: AWS::ApiGateway::DomainName | |
Properties: | |
DomainName: !Join [ . , [ my-api, !Ref hosted-zone-name ]] | |
CertificateArn: !Ref certificateArn | |
ApiBasePathMapping: | |
Type: 'AWS::ApiGateway::BasePathMapping' | |
Properties: | |
DomainName: !Ref ApiGwCustomDomainName | |
RestApiId: !Ref MyApiGateway | |
Stage: uat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment