【问题标题】:AWS: Get Route53 HostedZone NameAWS:获取 Route53 HostedZone 名称
【发布时间】:2018-11-05 16:00:16
【问题描述】:

我将记录集从云形成添加到 route53,这是代码

 "RDSDNSRecord" : {
      "Type" : "AWS::Route53::RecordSet",
      "Properties" : {

         "HostedZoneId" : { "Ref" : "DNSZoneId" },
         "Comment" : "DNS name for RDS",  
         "Name" : { "Fn::Join" : [ "", [ {  "Ref": "EnvType"}, "." ,"rds",".",{"Ref" : "AWS::Region"} ,".",{"Ref" : "HostedZone"},"." ] ] },
         "Type" : "CNAME",
         "TTL" : "900",
         "ResourceRecords" : [
           {
            "Ref": "DatabaseEndPoint"
         }
         ]
      }
   }

之前已经创建了 HostedZone。所以为了设置这些记录,我使用这些参数。

"DNSZoneId":{
         "Type" :"AWS::Route53::HostedZone::Id",
         "ConstraintDescription":"must be the name of an existing ZoneId"
      },
      "HostedZone":{
         "Type": "String",
          "Description":"Relavent Domain Name"
      }

aws 要求将完全限定的域名传递给参数 Name。所以我向用户询问域名以及 ZoneId。我觉得问 ID 和 Name 都不对。有没有办法从 zoneId 或任何解决方法获取名称?

【问题讨论】:

    标签: amazon-web-services amazon-cloudformation


    【解决方案1】:

    HostedZoneId是可选的,你也可以使用HostedZoneName

    HostedZoneId 托管区域的 ID。

    必需:有条件的。您必须指定 HostedZoneName 或 HostedZoneId,但您不能同时指定两者。如果此记录集是一部分 记录集组的,不要指定这个属性。

    【讨论】:

    • 是的,但在我的情况下有很多托管区域,因此我使用 "Type" :"AWS::Route53::HostedZone::Id" 列出所有区域。我检查并没有AWS参数类型来获取名称或者有什么办法吗?
    • 你找到答案了吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-08
    • 2014-05-14
    • 1970-01-01
    • 2019-02-20
    • 2021-01-30
    • 2019-05-19
    相关资源
    最近更新 更多