I am trying to specify subnets 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 subnets have to be of list type. How can i refer them in ELB based on the condition(that determines the region)