当尝试使用 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/