Created
August 13, 2020 06:21
-
-
Save khushi20218/397cc6701a816973c9ec22aa5ab9b415 to your computer and use it in GitHub Desktop.
This file contains 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
# Internet Gateway | |
resource "aws_internet_gateway" "tf_ig" { | |
vpc_id = aws_vpc.tf_vpc.id | |
tags = { | |
Name = "tf-ig" | |
} | |
} | |
# IGW Route Table | |
resource "aws_route_table" "tf_ig_route" { | |
vpc_id = aws_vpc.tf_vpc.id | |
route { | |
cidr_block = "0.0.0.0/0" | |
gateway_id = aws_internet_gateway.tf_ig.id | |
} | |
tags = { | |
Name = "tf-ig-route" | |
} | |
} | |
# IGW Route Association | |
resource "aws_route_table_association" "tf_ig_assoc" { | |
subnet_id = aws_subnet.pub_subnet1.id | |
route_table_id = aws_route_table.tf_ig_route.id | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment