我已经创建了 CloudFront 分配并尝试将该记录附加到 Route53 托管区域。 当我尝试时出现以下错误。
An error occurred: myDNSRecord - Invalid request: Expected exactly one of [AliasTarget, all of [TTL, and ResourceRecords], or TrafficPolicyInstanceId], but found none in Change with [Action=CREATE, Name=abc.yz.com., Type=A, SetIdentifier=null] (Service: AmazonRoute53; Status Code: 400; Error Code: InvalidInput; Request ID: 81fd7f48-3ffb-4fa1-b1ba-cef599834a07; Proxy: null)
myDNSRecord:
Type: AWS::Route53::RecordSetGroup
DependsOn:
- cloudFrontDist
Properties:
HostedZoneId: !Ref 53HostedZoneId
RecordSets:
- Name: abc.yz.com
Type: A
TTL: 300
AliasTarget:
HostedZoneId: Z2FDTNDATAQYW2
DNSName:
Fn::GetAtt: [cloudFrontDist, DomainName]
我想在route53中托管CloudFront分配URL
最佳答案
别名记录不使用 TTL。因此,将其从模板中删除:
myDNSRecord:
Type: AWS::Route53::RecordSetGroup
DependsOn:
- cloudFrontDist
Properties:
HostedZoneId: !Ref 53HostedZoneId
RecordSets:
- Name: abc.yz.com
Type: A
AliasTarget:
HostedZoneId: Z2FDTNDATAQYW2
DNSName:
Fn::GetAtt: [cloudFrontDist, DomainName]
关于amazon-web-services - 如何在route53 HostedZone中创建记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67806400/