我正在尝试根据区域类型为ELB指定子网这就是我的参数,例如
PublicSubnetsEastRegion:
Description: List of public subnets in us-west-2 region
Default: 'subnet-0bc21846adc3391fa,subnet-044a6f3e47331f209,subnet-0277131ad616e1b50'
Type: 'List<String>'
这就是我在ELB中引用的方式
BastionELB:
Type: AWS::ElasticLoadBalancing::LoadBalancer
Properties:
ConnectionDrainingPolicy:
Enabled: !Ref ELBConfigConnectionDraining
Timeout: !Ref ELBConfigConnectionDrainingTimeout
SecurityGroups:
- !Ref BastionClientsdevELBIntuitSecurityGroup
Subnets:
- !If [ isRegionUS-WEST-2, !Ref PublicSubnetsWestRegion, !Ref PublicSubnetsEastRegion ]
但是这会抛出错误,子网必须是列表类型的。我如何在ELB中根据条件(决定区域)引用它们
您不需要-
。应该是:
Subnets:
!If [ isRegionUS-WEST-2, !Ref PublicSubnetsWestRegion, !Ref PublicSubnetsEastRegion ]