-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
Related Issues
Description
Milestone 2 targets adding Route53 support to Custom Domains feature. This task is to track adding Route 53 type A records to a provided HostedZone. If using EDGE, the AWS::CloudFront::Distribution
resource must be defined in the same template.
SAM input -
Type: AWS::Serverless::Api
Properties:
Domain:
DomainName: example.com
Certificate: !Ref MyCertificate
EndpointConfiguration: REGIONAL | EDGE
Route53:
EvaluateTargetHealth: true #false by default, must be false for EDGE
HostedZoneId: xyz # required
Resource changes - Must create AWS::Route53::RecordSetGroup
REGIONAL -
APIDomainName:
Type: 'AWS::ApiGateway::DomainName'
Properties:
EndpointConfiguration:
Types: [REGIONAL]
RegionalCertificateArn: !Ref Certificate
DomainName: !Ref DomainName
DomainNameTypeARoute53RecordSet:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneId: !Ref HostedZoneId
RecordSets:
- Name: !Ref DomainName
Type: A
AliasTarget:
DNSName: !GetAtt APIDomainName.RegionalDomainName
HostedZoneId: !GetAtt APIDomainName.RegionalHostedZoneId
EDGE -
APIDomainName:
Type: 'AWS::ApiGateway::DomainName'
Properties:
EndpointConfiguration:
Types: [EDGE]
CertificateArn: !Ref CertificateARN
DomainName: !Ref DomainName
DomainNameTypeARoute53RecordSet:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneId: !Ref HostedZoneId
RecordSets:
- Name: !Ref DomainName
Type: A
AliasTarget:
HostedZoneId: Z2FDTNDATAQYW2 # (const value for cloudfront distributions)
DNSName: !GetAtt Distribution.DomainName