【发布时间】:2017-03-20 13:53:53
【问题描述】:
我正在尝试为 Route53 Private Hosted Zone 创建 Cloud Formation 模板,其中与 PHZ 关联的 VPC 和区域列表作为参数提供
VPCIds:
Type: List<AWS::EC2::VPC::Id>
Description: The Evertz VPC Id
Regions:
Type: CommaDelimitedList
Description: A list that containing the matching regions for the VPCs given
NumberOfVPC:
Type: Number
我已经设置了用于指定 VPC 数量的条件。
Conditions:
2VPC: !Or [
!Equals [!Ref NumberOfVPC, 2],
Condition: 3VPC,
Condition: 4VPC,
Condition: 5VPC,
Condition: 6VPC,
Condition: 7VPC,
Condition: 8VPC
]
3VPC: !Or [
!Equals [!Ref NumberOfVPC, 3],
Condition: 4VPC,
Condition: 5VPC,
Condition: 6VPC,
Condition: 7VPC,
Condition: 8VPC
]...
很遗憾,我无法创建HostedZoneVPCs 的列表
我希望在构建列表时使用这些条件来提供 AWS::NoValue
Route53PrivateHostedZone:
Type: "AWS::Route53::HostedZone"
Properties:
Name: !Ref ZoneName
HostedZoneConfig:
Comment: String
HostedZoneTags:
- Key: Name
Value: Hosted Zone
VPCs:
-
VPCId: !If [2VPC, !Ref "AWS::NoValue", !Select [0, !Ref VPCIds]]
VPCRegion: !If [2VPC, !Ref "AWS::NoValue", !Select [0, !Ref Regions]]
VPCs:
- VPCId: !If [2VPC, !Select [0, !Ref VPCIds], !Ref "AWS::NoValue"]
VPCRegion: !If [2VPC, !Select [0, !Ref Regions], !Ref "AWS::NoValue"]
- VPCId: !If [2VPC, !Select [1, !Ref VPCIds], !Ref "AWS::NoValue"]
VPCRegion: !If [2VPC, !Select [1, !Ref Regions], !Ref "AWS::NoValue"]
但是这不起作用并且无法创建托管区域。
在 Cloudformation 中是否有任何方法可以使用我创建的 xVPC 条件构建HostedZoneVPCs 列表?
【问题讨论】:
标签: amazon-web-services amazon-cloudformation amazon-route53