I created the stack using amazon cloudformation in yaml.
• VPC with 4 Subnets (2 Public and 2 Private).
• Each public and private subnets were placed in the AZ ap-south-1a (1 public, 1 private and in ap-south-1b (1 public and 1 private).
• Created Route Tables for public and private subnets.
• Tried associating the the public subnets of 1a and 1b to the public RT but it doesn't worked. but if i associate 1 subnet to this public rt it does work.
How to associate multiple subnets to a route table using cloudformation (yaml)?
Thank in advance.
CFPublicRT: Type: AWS::EC2::RouteTable Properties: Tags: - Key: Name Value: Public RT VpcId: !Ref CFVPC CFPrivateRT: Type: AWS::EC2::RouteTable Properties: Tags: - Key: Name Value: Private RT VpcId: !Ref CFVPC routetablepublicsubnetassociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: RouteTableId: !Ref CFPublicRT SubnetId: !Ref CFPublicSubnet1a routetableprivatesubnetassociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: RouteTableId: !Ref CFPrivateRT SubnetId: !Ref CFPrivateSubnet1a