diff --git a/nat gateway reference.tf b/nat gateway reference.tf deleted file mode 100644 index 69d7f49..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 = - - 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 = - - 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 diff --git a/vpc reference.tf b/vpc reference.tf deleted file mode 100644 index dbcf838..0000000 --- a/vpc reference.tf +++ /dev/null @@ -1,120 +0,0 @@ -# create vpc -resource "aws_vpc" "vpc" { - cidr_block = - instance_tenancy = - 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