From c1026154d4b70a7c726334aa20db290dc2710102 Mon Sep 17 00:00:00 2001 From: Rob Schoening Date: Mon, 23 May 2022 12:46:32 -0700 Subject: [PATCH] Create testing.tf --- terraform-aws/testing.tf | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 terraform-aws/testing.tf diff --git a/terraform-aws/testing.tf b/terraform-aws/testing.tf new file mode 100644 index 0000000..c8715a1 --- /dev/null +++ b/terraform-aws/testing.tf @@ -0,0 +1,29 @@ +resource "aws_route_table" "public" { + vpc_id = aws_vpc.main.id + route { + cidr_block = "0.0.0.0/0" + gateway_id = aws_internet_gateway.gateway.id + } + tags = { + Name = "public route" + } +} + +resource "aws_route_table_association" "public" { + subnet_id = aws_subnet.public.id + route_table_id = aws_route_table.public.id +} + +resource "aws_route_table" "private" { + vpc_id = aws_vpc.main.id + route { + cidr_block = "0.0.0.0/0" + instance_id = "aws_instance.nat.id" + } +} + +/* Associate the routing table to public subnet */ +resource "aws_route_table_association" "private" { + subnet_id = aws_subnet.private.id + route_table_id = aws_route_table.private.id +}