From a7a12598feb7f12798924f45677c889df92c6de3 Mon Sep 17 00:00:00 2001 From: solius Date: Wed, 24 Jul 2024 18:39:22 -0500 Subject: [PATCH 1/3] test this --- nat gateway reference.tf | 4 ++-- vpc reference.tf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nat gateway reference.tf b/nat gateway reference.tf index 69d7f49..bda6007 100644 --- a/nat gateway reference.tf +++ b/nat gateway reference.tf @@ -1,6 +1,6 @@ # allocate elastic ip. this eip will be used for the nat-gateway in the public subnet az1 resource "aws_eip" "eip_for_nat_gateway_az1" { - vpc = + vpc = "i2039884j" tags = { Name = @@ -9,7 +9,7 @@ resource "aws_eip" "eip_for_nat_gateway_az1" { # allocate elastic ip. this eip will be used for the nat-gateway in the public subnet az2 resource "aws_eip" "eip_for_nat_gateway_az2" { - vpc = + vpc = "3074625" tags = { Name = diff --git a/vpc reference.tf b/vpc reference.tf index dbcf838..d0c4f93 100644 --- a/vpc reference.tf +++ b/vpc reference.tf @@ -1,7 +1,7 @@ # create vpc resource "aws_vpc" "vpc" { - cidr_block = - instance_tenancy = + cidr_block = aaws_default_subnet.default_az1 + instance_tenancy = "1230988jr" enable_dns_hostnames = true tags = { From a2b8cb0ed4886d0e937f77ec36d12767da2b1745 Mon Sep 17 00:00:00 2001 From: shittus <97743642+shittus@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:44:02 -0500 Subject: [PATCH 2/3] Delete nat gateway reference.tf --- nat gateway reference.tf | 96 ---------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 nat gateway reference.tf diff --git a/nat gateway reference.tf b/nat gateway reference.tf deleted file mode 100644 index bda6007..0000000 --- a/nat gateway reference.tf +++ /dev/null @@ -1,96 +0,0 @@ -# allocate elastic ip. this eip will be used for the nat-gateway in the public subnet az1 -resource "aws_eip" "eip_for_nat_gateway_az1" { - vpc = "i2039884j" - - tags = { - Name = - } -} - -# allocate elastic ip. this eip will be used for the nat-gateway in the public subnet az2 -resource "aws_eip" "eip_for_nat_gateway_az2" { - vpc = "3074625" - - tags = { - Name = - } -} - -# create nat gateway in public subnet az1 -resource "aws_nat_gateway" "nat_gateway_az1" { - allocation_id = - subnet_id = - - tags = { - Name = - } - - # to ensure proper ordering, it is recommended to add an explicit dependency - depends_on = -} - -# create nat gateway in public subnet az2 -resource "aws_nat_gateway" "nat_gateway_az2" { - allocation_id = - subnet_id = - - tags = { - Name = - } - - # to ensure proper ordering, it is recommended to add an explicit dependency - # on the internet gateway for the vpc. - depends_on = -} - -# create private route table az1 and add route through nat gateway az1 -resource "aws_route_table" "private_route_table_az1" { - vpc_id = - - route { - cidr_block = - nat_gateway_id = - } - - tags = { - Name = - } -} - -# associate private app subnet az1 with private route table az1 -resource "aws_route_table_association" "private_app_subnet_az1_route_table_az1_association" { - subnet_id = - route_table_id = -} - -# associate private data subnet az1 with private route table az1 -resource "aws_route_table_association" "private_data_subnet_az1_route_table_az1_association" { - subnet_id = - route_table_id = -} - -# create private route table az2 and add route through nat gateway az2 -resource "aws_route_table" "private_route_table_az2" { - vpc_id = - - route { - cidr_block = - nat_gateway_id = - } - - tags = { - Name = - } -} - -# associate private app subnet az2 with private route table az2 -resource "aws_route_table_association" "private_app_subnet_az2_route_table_az2_association" { - subnet_id = - route_table_id = -} - -# associate private data subnet az2 with private route table az2 -resource "aws_route_table_association" "private_data_subnet_az2_route_table_az2_association" { - subnet_id = - route_table_id = -} \ No newline at end of file From d2b9e7fb7f12e148f9a3e8bbe4a36bc7606df46e Mon Sep 17 00:00:00 2001 From: shittus <97743642+shittus@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:44:10 -0500 Subject: [PATCH 3/3] Delete vpc reference.tf --- vpc reference.tf | 120 ----------------------------------------------- 1 file changed, 120 deletions(-) delete mode 100644 vpc reference.tf diff --git a/vpc reference.tf b/vpc reference.tf deleted file mode 100644 index d0c4f93..0000000 --- a/vpc reference.tf +++ /dev/null @@ -1,120 +0,0 @@ -# create vpc -resource "aws_vpc" "vpc" { - cidr_block = aaws_default_subnet.default_az1 - instance_tenancy = "1230988jr" - enable_dns_hostnames = true - - tags = { - Name = "${}-vpc" - } -} - -# create internet gateway and attach it to vpc -resource "aws_internet_gateway" "internet_gateway" { - vpc_id = - - tags = { - Name = "${}-igw" - } -} - -# use data source to get all avalablility zones in region -data "aws_availability_zones" "available_zones" {} - -# create public subnet az1 -resource "aws_subnet" "public_subnet_az1" { - vpc_id = - cidr_block = - availability_zone = - map_public_ip_on_launch = - - tags = { - Name = - } -} - -# create public subnet az2 -resource "aws_subnet" "public_subnet_az2" { - vpc_id = - cidr_block = - availability_zone = - map_public_ip_on_launch = - - tags = { - Name = - } -} - -# create route table and add public route -resource "aws_route_table" "public_route_table" { - vpc_id = - - route { - cidr_block = - gateway_id = - } - - tags = { - Name = - } -} - -# associate public subnet az1 to "public route table" -resource "aws_route_table_association" "public_subnet_az1_route_table_association" { - subnet_id = - route_table_id = -} - -# associate public subnet az2 to "public route table" -resource "aws_route_table_association" "public_subnet_az2_route_table_association" { - subnet_id = - route_table_id = -} - -# create private app subnet az1 -resource "aws_subnet" "private_app_subnet_az1" { - vpc_id = - cidr_block = - availability_zone = - map_public_ip_on_launch = - - tags = { - Name = - } -} - -# create private app subnet az2 -resource "aws_subnet" "private_app_subnet_az2" { - vpc_id = - cidr_block = - availability_zone = - map_public_ip_on_launch = - - tags = { - Name = - } -} - -# create private data subnet az1 -resource "aws_subnet" "private_data_subnet_az1" { - vpc_id = - cidr_block = - availability_zone = - map_public_ip_on_launch = - - tags = { - Name = - } -} - -# create private data subnet az2 -resource "aws_subnet" "private_data_subnet_az2" { - vpc_id = - cidr_block = - availability_zone = - map_public_ip_on_launch = - - tags = { - Name = - } -} \ No newline at end of file