json - "Encountered unsupported property Type"Route53 的 Cloudformation 错误

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

当尝试使用 cloudformation 构建 AWS::Route53::RecordSet 时,我收到“遇到不支持的属性类型”错误。我假设这意味着它无法识别 JSON 中的 "Type": "A"。但是,这是 AWS::Route53::RecordSet 和 is even in the example AWS gives in the documentation. 的有效属性。 (我知道这是针对 RecordSetGroup 的,但底部的示例构建了一个 RecordSet)。

我还尝试复制并粘贴亚马逊提供的确切示例,并将其值替换为我的值。还是没有运气。

这是我的代码:

"DNS" : {
      "Type": "AWS::Route53::RecordSet",
      "Properties": {
        "HostedZoneName": {
          "Ref": "HostedZoneName"
        },
        "Comment": "DNS name for my instance.",
        "Name": {
          "Fn::Join": [
            "",
            [
              {
                "Ref": "ComponentDNSName"
              },
              {
                "Ref": "HostedZoneName"
              }
            ]
          ]
        },
        "Type": "A",
        "TTL": "900",
        "ResourceRecords": [
          {
            "Fn::GetAtt": [
              {
                "Fn::GetAtt": [
                  "Ec2Instance",
                  "PrivateIp"
                ]
              }
            ]
          }
        ]
      }
    }

我认为括号可能位于错误的位置,但我已经仔细检查过它以及我的堆栈中的其他资源(警报、EC2Instance)构建良好。

感谢您的帮助。

最佳答案

我认为问题出在 ResourceRecords 上。将当前的替换为

   "ResourceRecords": [
      {
        "Fn::GetAtt": [
            "Ec2Instance",
            "PrivateIp"
        ]
      }
    ]

如果你有多个输入要添加到ResourceRecords中,它将变成

   "ResourceRecords": [
      {
        "Fn::GetAtt": [
            "name1",
            "resource1"
        ]
      },
      {
        "Fn::GetAtt": [
            "name2",
            "resource2"
        ]
      }
    ]

希望这有帮助。

关于json - "Encountered unsupported property Type"Route53 的 Cloudformation 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56382675/

相关文章:

json - Swift Realm 导入 Json 数组数据

amazon-web-services - 如何从 AWS S3 存储桶流式传输预签名视频?

amazon-web-services - 从 AWS ApiGateway 重定向到公共(public) ELB

java - 如何在 Java 中实现 DynamoDB 分区键大小的验证

amazon-web-services - 云形成: How to get VPC from Subnet Id

aws-lambda - 无法从 Lambda 函数查询 DynamoDB 表

json - 如何将 json 模式分解为单独的文件?

java - 使用 ModelMapper 将 JsonNode 转换为对象

amazon-web-services - cloudformation中定义的资源权限

c# - 从C#请求JSON时如何解决 "The required anti-forgery cookie\"__RequestVerificationToken\"is not present."?