Created
February 26, 2019 19:29
-
-
Save 100daysofdevops/4cb1842fb6874333b1b3f555ccdffa2d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Associate Public Subnet with Public Route Table | |
| resource "aws_route_table_association" "public_subnet_assoc" { | |
| count = "${aws_subnet.public_subnet.count}" | |
| route_table_id = "${aws_route_table.public_route.id}" | |
| subnet_id = "${aws_subnet.public_subnet.*.id[count.index]}" | |
| depends_on = ["aws_route_table.public_route", "aws_subnet.public_subnet"] | |
| } | |
| # Associate Private Subnet with Private Route Table | |
| resource "aws_route_table_association" "private_subnet_assoc" { | |
| count = "${aws_subnet.private_subnet.count}" | |
| route_table_id = "${aws_default_route_table.private_route.id}" | |
| subnet_id = "${aws_subnet.private_subnet.*.id[count.index]}" | |
| depends_on = ["aws_default_route_table.private_route", "aws_subnet.private_subnet"] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment