我正在为许多域创建CFN堆栈。域不是AWS注册表,而是第三方域。
我希望将SOA中的名称服务器列表作为堆栈输出的一部分。但是,因为它们不是作为字符串返回的,但根据文档,“set”,我无法弄清楚如何提取和返回它们。
细节:
根据AWS::Route53::HostedZone
的文档,您可以获取名称服务器列表
返回值
[...]
FN :: GetAtt
Fn :: GetAtt返回此类型的指定属性的值。以下是可用属性和样本返回值。
域名服务器
Returns the **set** of name servers for the specific hosted zone. For example: ns1.example.com. This attribute is not supported for private hosted zones.
所以,我试着这样做:
Resources:
MyZone:
Type: 'AWS::Route53::HostedZone'
Properties:
Name: my.domain.
...
Outputs:
MyZone:
Value: !Ref MyZone
MyZoneServers:
Value: !GetAtt MyZone.NameServers
但这给了:
An error occurred (ValidationError) when calling the UpdateStack operation: Template format error: The Value field of every Outputs member must evaluate to a String.
当我只输出区域ref时,它可以正常工作并获得区域的Z ...字符串。
我尝试了各种其他技巧和方法,主要是各种内在功能,如!Split
,!Select
等。我似乎无处可寻找这个“设置”是什么:列表?逗号分隔的字符串? (在这种情况下!Split
应该工作)
在创建堆栈后,我可以通过Route53的describe函数检索名称服务器,但我的感觉是我遗漏了一些非常明显的东西,所以不想添加额外的步骤。