简体   繁体   中英

How to specify list of subnets for ELB from the Parameters?

I am trying to specify su.nets for ELB based on the region type This is what i have in my parameters for example

PublicSubnetsEastRegion:
  Description: List of public subnets in us-west-2 region 
  Default: 'subnet-0bc21846adc3391fa,subnet-044a6f3e47331f209,subnet-0277131ad616e1b50'
  Type: 'List<String>'

This is how i am referencing in 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 ]

But this keeps throwing the error su.nets have to be of list type. How can i refer them in ELB based on the condition(that determines the region)

You do not need - . It should be:

   Subnets:
      !If [ isRegionUS-WEST-2, !Ref PublicSubnetsWestRegion, !Ref PublicSubnetsEastRegion ]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM