amazon-web-services - 如何在route53 HostedZone中创建记录

标签 amazon-web-services aws-cloudformation amazon-cloudfront amazon-route53

我已经创建了 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/

相关文章:

php - AWS SES 缺少最终 '@domain' PHP SDK

amazon-web-services - Cloudformation 创建的 Autoscaling 组超时

amazon-web-services - AWS Cloudformation 创建堆栈模板错误

带 SSL 的 WordPress

wordpress - 如何使用适用于 WordPress 的 lightsail 设置 AWS cloudfront?

linux - 使用来自 NoMachine 的 'NX free edition for Linux' 在 Amazon EC2 上运行 Ubuntu 13.04/Linux mint 14

amazon-web-services - 如何将过滤器与 boto3 vpc 端点服务结合使用?

amazon-web-services - 部署CFN模板时资源之间的竞争条件?

amazon-web-services - Cloudfront 将 url 重写为 S3

javascript - 使用 Lambda IAM 角色以管理员身份对 Cognito 进行身份验证