Skip to content

Instantly share code, notes, and snippets.

@eoinsha
Created August 7, 2019 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eoinsha/2aa26d959dffc98f1c85986a14ae8747 to your computer and use it in GitHub Desktop.
Save eoinsha/2aa26d959dffc98f1c85986a14ae8747 to your computer and use it in GitHub Desktop.
apiCustomDomain:
Type: AWS::ApiGateway::DomainName
Properties:
CertificateArn: ${self:custom.apiConfig.apiCert}
DomainName: api.sliclists.com
apiCustomDomainPathMappings:
Type: AWS::ApiGateway::BasePathMapping
Properties:
BasePath: ''
RestApiId:
Ref: ApiGatewayRestApi
DomainName:
Ref: apiCustomDomain
Stage: prod
apiDomainDns:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneId: ${self:custom.apiConfig.publicHostedZone}
RecordSets:
- Name: ${self:resources.Resources.apiCustomDomain.Properties.DomainName}
Type: A
AliasTarget:
DNSName: { Fn::GetAtt: [apiCustomDomain, DistributionDomainName] }
HostedZoneId: ${self:custom.cloudFrontHostedZoneId}
- Name: ${self:resources.Resources.apiCustomDomain.Properties.DomainName}
Type: AAAA
AliasTarget:
DNSName: { Fn::GetAtt: [apiCustomDomain, DistributionDomainName] }
HostedZoneId: ${self:custom.cloudFrontHostedZoneId}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment