我正在为多个域创建一个 CFN 堆栈。该域不在 AWS 注册表中,而是在第三方注册表中。
我希望将 SOA 中的名称服务器列表作为堆栈输出的一部分。但是,由于它们不是作为字符串返回,而是根据文档,“集合”,我无法弄清楚如何提取和返回它们。
细节:
根据 docs for AWS::Route53::HostedZone,您可以获得名称服务器列表
返回值
[...]
Fn::GetAtt
Fn::GetAtt 返回此类型的指定属性的值。以下是可用的属性和示例返回值。
名称服务器
Run Code Online (Sandbox Code Playgroud)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
Run Code Online (Sandbox Code Playgroud)
但这给出了:
An error occurred (ValidationError) when calling the UpdateStack operation: Template format error: The Value field of every Outputs …Run Code Online (Sandbox Code Playgroud)