Skip to content

Commit

Permalink
Added private route table
Browse files Browse the repository at this point in the history
  • Loading branch information
qtsathish committed Mar 3, 2021
1 parent 5a97bd1 commit ec98b00
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Feb21/ntier-tf-aws/main.tf
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ resource "aws_route_table" "publicrt" {
aws_subnet.subnets[1] aws_subnet.subnets[1]
] ]


tags = {
"Name" = "publicrt"
}

} }


resource "aws_route_table_association" "webassociations" { resource "aws_route_table_association" "webassociations" {
Expand All @@ -67,4 +71,33 @@ resource "aws_route_table_association" "webassociations" {


} }


resource "aws_route_table" "privatert" {
vpc_id = aws_vpc.ntiervpc.id
tags = {
"Name" = "privatert"
}

depends_on = [
aws_vpc.ntiervpc,
aws_subnet.subnets[2],
aws_subnet.subnets[3],
aws_subnet.subnets[4],
aws_subnet.subnets[5],
]


}

resource "aws_route_table_association" "app1association" {

count = 4
route_table_id = aws_route_table.privatert.id
subnet_id = aws_subnet.subnets[count.index + 2].id

depends_on = [
aws_route_table.privatert
]

}



0 comments on commit ec98b00

Please sign in to comment.