小编Mar*_*kai的帖子

将 HostedZone NameServers 指定为 CloudFormation 输出

我正在为多个域创建一个 CFN 堆栈。该域不在 AWS 注册表中,而是在第三方注册表中。

我希望将 SOA 中的名称服务器列表作为堆栈输出的一部分。但是,由于它们不是作为字符串返回,而是根据文档,“集合”,我无法弄清楚如何提取和返回它们。

细节:

根据 docs for 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.
Run Code Online (Sandbox Code Playgroud)

所以,我试图这样做:

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)

aws-cloudformation amazon-route53

5
推荐指数
1
解决办法
969
查看次数

标签 统计

amazon-route53 ×1

aws-cloudformation ×1