AWS cfn资源创建失败记录集

AWS cfn资源创建失败记录集

问题描述:

我想部署一个使用cloudformation的静态网站,但我在创建记录集时遇到问题。堆栈创建成功,直到资源部分中的托管区域。我不确定为什么创建托管区域的记录集有问题。AWS cfn资源创建失败记录集

Error: The following resource(s) failed to create: [RecordSet].

 --- 
AWSTemplateFormatVersion: '2010-09-09' 
Description: 'Assuming that you already have a Hosted Zone registered with Amazon Route 53, this Cfn template is to create a static site' 
# Metadata: 
# 'AWS::CloudFormation::Interface': 
#  ParameterGroups: 
#  - Label: 
#   default: 'HostedZone name' 
#   Parameters: 
#   - HostedZoneName 
Parameters: 
    HostedZoneName: 
    Description: "The DNS name of an existing Amazon Route 53 hosted zone" 
    Type: String 
    AllowedPattern: "(?!-)[a-zA-Z0-9-.]{1,63}(?<!-)" 
    Default: "thecloudcrew.net" 


Resources: 

    S3Bucket: 
    Type: AWS::S3::Bucket 
    Properties: 
     AccessControl: PublicRead 
     BucketName: !Ref HostedZoneName 
     WebsiteConfiguration: 
     IndexDocument: index.html 
     ErrorDocument: error.html 
     LoggingConfiguration: 
     DestinationBucketName: !Ref S3LoggingBucket 
     LogFilePrefix: logs 

    WWWS3Bucket: 
    Type: AWS::S3::Bucket 
    Properties: 
     BucketName: !Sub 
     - www.${domain} 
     - { domain: !Ref HostedZoneName} 
     WebsiteConfiguration: 
     RedirectAllRequestsTo: 
      HostName: !Ref HostedZoneName 

    S3LoggingBucket: 
    Type: AWS::S3::Bucket 
    Properties: 
     BucketName: !Sub 
     - ${domain}.logs 
     - { domain: !Ref HostedZoneName} 
     AccessControl: LogDeliveryWrite 

    HostedZone: 
    Type: "AWS::Route53::HostedZone" 
    Properties: 
     HostedZoneConfig: 
     Comment: "My Hosted zone for thecloudcrew.net" 
     HostedZoneTags: 
     - 
      Key: Name 
      Value: thecloudcrew 
     Name: !Ref HostedZoneName 

    RecordSet: #FIXME 
    Type: "AWS::Route53::RecordSet" 
    Properties: 
     AliasTarget: 
     DNSName: s3-website.us-east-2.amazonaws.com 
     HostedZoneId: Z2O1EMRO9K5GLX 
     Comment: "RecordSet for static website" 
     HostedZoneId: !Ref HostedZone #TODO 
     Name: !Ref HostedZone 
     Type: A 
     #Region: 'us-east-2' 
     # SetIdentifier: String 
     # TTL: String 
     # Weight: Integer 
+0

当您点击错误来展开它时,它会为您提供更多信息吗? – kichik

你缺少Type: A财产,你必须HostedZoneId更换HosteZoneName。此外,删除Region它是全球性的Route53中没有用。

+0

我做了更改,仍然收到错误“RRSet与DNS名称z3b9u6qmuquywf。不允许在zone thecloudcrew.net中。” –