diff --git a/.gitignore b/.gitignore index c382709..a193ff6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ ./webapp/node_modules/* ./webapp/package-lock.json webapp/node_modules/ -webapp/package-lock.json \ No newline at end of file +webapp/package-lock.json +iac/aws/terraform/creating-custom-vpc/.terraform/ diff --git a/iac/aws/terraform/creating-custom-vpc/.terraform.lock.hcl b/iac/aws/terraform/creating-custom-vpc/.terraform.lock.hcl new file mode 100644 index 0000000..c1b3dfe --- /dev/null +++ b/iac/aws/terraform/creating-custom-vpc/.terraform.lock.hcl @@ -0,0 +1,20 @@ +# This file is maintained automatically by "tofu init". +# Manual edits may be lost in future updates. + +provider "registry.opentofu.org/hashicorp/aws" { + version = "5.48.0" + constraints = "~> 5.0" + hashes = [ + "h1:cntHD8f3TycbLB4klO+ZQCEDd+bMWeIE3h1DUIAxXlo=", + "zh:212b33b4270a4f20025dec83b181b0e8044ef382491e0c89ad07c64d6dfacff0", + "zh:2dd2dadd6fc8752edb6241bdac1bdd49ce64384527dc335a021d61d3870a0393", + "zh:3d449e369958ab3d0afe2db6be5de22061f8635fe176771c98af41a7f770f1b5", + "zh:3dd6ca9a102c6164683800d8b1b5def29a51d575b5223063961125de81cca136", + "zh:422586cf2ea78f8464c97b95f153acdc84b660b2eb474a100338e360593e2d84", + "zh:70ea10113b724cc69f83e2c1fd65d7d304aaf6bd9f6a45cd1622a5f36506690c", + "zh:84a48c4a7eb8498beb9f5d78bef5e58516e11a8df131042fb43d3dec62dc899b", + "zh:9724c095fb8d8d7695769a828e6cc0de95da264487c91af39a645713b293323c", + "zh:ad9117ef8c7fd8e26aab482a286aa2e641e4887d1816117caa1fd7eaff6a050c", + "zh:ff32af11624e5104fd4ddd38cecd1beb09da9a7be7f49b0d496080667882b90e", + ] +} diff --git a/iac/aws/terraform/creating-custom-vpc/000.provider.tf b/iac/aws/terraform/creating-custom-vpc/000.provider.tf new file mode 100644 index 0000000..4b970f1 --- /dev/null +++ b/iac/aws/terraform/creating-custom-vpc/000.provider.tf @@ -0,0 +1,24 @@ +variable aws_region { + default = "us-east-1" + description = "AWS region where the resources will be provisioned" +} + +# Configure the AWS Provider +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 5.0" + } + # helm = { + # source = "hashicorp/aws" + # version = "~> 2.6" + # } + } +} + +# Configure region and profile +provider "aws" { + region = var.aws_region + profile = "myaws" +} \ No newline at end of file diff --git a/iac/aws/terraform/creating-custom-vpc/001.vpc.tf b/iac/aws/terraform/creating-custom-vpc/001.vpc.tf new file mode 100644 index 0000000..7d42e35 --- /dev/null +++ b/iac/aws/terraform/creating-custom-vpc/001.vpc.tf @@ -0,0 +1,10 @@ +resource "aws_vpc" "mycustomvpc" { + cidr_block = "10.0.0.0/16" + enable_dns_support = true + enable_dns_hostnames = true + + tags = { + "owner" = "vinod" + "Name" = "my custom VPC" + } +} \ No newline at end of file diff --git a/iac/aws/terraform/creating-custom-vpc/002.internet.gateway.tf b/iac/aws/terraform/creating-custom-vpc/002.internet.gateway.tf new file mode 100644 index 0000000..9f3d037 --- /dev/null +++ b/iac/aws/terraform/creating-custom-vpc/002.internet.gateway.tf @@ -0,0 +1,7 @@ +resource "aws_internet_gateway" "igw" { + vpc_id = aws_vpc.mycustomvpc.id + tags = { + "owner" = "vinod" + "Name" = "IGW" + } +} \ No newline at end of file diff --git a/iac/aws/terraform/creating-custom-vpc/003.subnets.tf b/iac/aws/terraform/creating-custom-vpc/003.subnets.tf new file mode 100644 index 0000000..3986ca2 --- /dev/null +++ b/iac/aws/terraform/creating-custom-vpc/003.subnets.tf @@ -0,0 +1,45 @@ +resource "aws_subnet" "private-us-east-1a" { + vpc_id = aws_vpc.mycustomvpc.id + cidr_block = "10.0.1.0/24" + availability_zone = "us-east-1a" + + tags = { + "subnet" = "private-us-east-1a" + "Name" = "Private Subnet" + } +} + +resource "aws_subnet" "private-us-east-1b" { + vpc_id = aws_vpc.mycustomvpc.id + cidr_block = "10.0.2.0/24" + availability_zone = "us-east-1b" + + tags = { + "subnet" = "private-us-east-1b" + "Name" = "Private Subnet" + } +} + +resource "aws_subnet" "public-us-east-1a" { + vpc_id = aws_vpc.mycustomvpc.id + cidr_block = "10.0.3.0/24" + availability_zone = "us-east-1a" + map_public_ip_on_launch = true + + tags = { + "subnet" = "public-us-east-1a" + "Name" = "Public Subnet" + } +} + +resource "aws_subnet" "public-us-east-1b" { + vpc_id = aws_vpc.mycustomvpc.id + cidr_block = "10.0.4.0/24" + availability_zone = "us-east-1b" + map_public_ip_on_launch = true + + tags = { + "subnet" = "public-us-east-1b" + "Name" = "Public Subnet" + } +} \ No newline at end of file diff --git a/iac/aws/terraform/creating-custom-vpc/004.nat.tf b/iac/aws/terraform/creating-custom-vpc/004.nat.tf new file mode 100644 index 0000000..76ad8b7 --- /dev/null +++ b/iac/aws/terraform/creating-custom-vpc/004.nat.tf @@ -0,0 +1,24 @@ + +resource "aws_eip" "nat" { + vpc = true + + tags = { + "Name" = "EIP" + "Owner" = "Vinod" + } + +} + +resource "aws_nat_gateway" "nat" { + allocation_id = aws_eip.nat.id + subnet_id = aws_subnet.public-us-east-1a.id + + tags = { + "Name" = "NAT Gateway" + "Owner" = "Vinod" + } + + # To ensure proper ordering, it is recommended to add an explicit dependency + # on the Internet Gateway for the VPC. + depends_on = [aws_internet_gateway.igw] +} \ No newline at end of file diff --git a/iac/aws/terraform/creating-custom-vpc/005.routes.tf b/iac/aws/terraform/creating-custom-vpc/005.routes.tf new file mode 100644 index 0000000..a40202c --- /dev/null +++ b/iac/aws/terraform/creating-custom-vpc/005.routes.tf @@ -0,0 +1,42 @@ +resource "aws_route_table" "privateroute" { + vpc_id = aws_vpc.mycustomvpc.id + + route { + cidr_block = "0.0.0.0/0" + nat_gateway_id = aws_nat_gateway.nat.id + } + + tags = { + Name = "private" + } +} + +resource "aws_route_table" "publicroute" { + vpc_id = aws_vpc.mycustomvpc.id + + route { + cidr_block = "0.0.0.0/0" + gateway_id = aws_internet_gateway.igw.id + } + + tags = { + Name = "public" + } +} + +resource "aws_route_table_association" "privateassociation_a" { + subnet_id = aws_subnet.private-us-east-1a.id + route_table_id = aws_route_table.privateroute.id +} +resource "aws_route_table_association" "privateassociation_b" { + subnet_id = aws_subnet.private-us-east-1b.id + route_table_id = aws_route_table.privateroute.id +} +resource "aws_route_table_association" "publicassociation_a" { + subnet_id = aws_subnet.public-us-east-1a.id + route_table_id = aws_route_table.publicroute.id +} +resource "aws_route_table_association" "publicassociation_b" { + subnet_id = aws_subnet.public-us-east-1b.id + route_table_id = aws_route_table.publicroute.id +} \ No newline at end of file diff --git a/iac/aws/terraform/creating-custom-vpc/README.md b/iac/aws/terraform/creating-custom-vpc/README.md new file mode 100644 index 0000000..fa00fab --- /dev/null +++ b/iac/aws/terraform/creating-custom-vpc/README.md @@ -0,0 +1,6 @@ +## Description +Creating a custom VPC using OpenTofu. + +## Architecture +![Alt text](https://drive.google.com/file/d/1-1enJhmxFLkUp2jaqOkKGFqueP6cF68W/view?usp=sharing) + diff --git a/iac/aws/terraform/creating-custom-vpc/terraform.tfstate b/iac/aws/terraform/creating-custom-vpc/terraform.tfstate new file mode 100644 index 0000000..94647e4 --- /dev/null +++ b/iac/aws/terraform/creating-custom-vpc/terraform.tfstate @@ -0,0 +1,567 @@ +{ + "version": 4, + "terraform_version": "1.7.0", + "serial": 12, + "lineage": "69ea60e4-e317-8e43-6a2c-43fc92d249d3", + "outputs": {}, + "resources": [ + { + "mode": "managed", + "type": "aws_eip", + "name": "nat", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "address": null, + "allocation_id": "eipalloc-0dec4e7657e6f0c73", + "arn": "arn:aws:ec2:us-east-1:458419607076:elastic-ip/eipalloc-0dec4e7657e6f0c73", + "associate_with_private_ip": null, + "association_id": "", + "carrier_ip": "", + "customer_owned_ip": "", + "customer_owned_ipv4_pool": "", + "domain": "vpc", + "id": "eipalloc-0dec4e7657e6f0c73", + "instance": "", + "network_border_group": "us-east-1", + "network_interface": "", + "private_dns": null, + "private_ip": "", + "ptr_record": "", + "public_dns": "ec2-34-239-9-241.compute-1.amazonaws.com", + "public_ip": "34.239.9.241", + "public_ipv4_pool": "amazon", + "tags": { + "Name": "EIP", + "Owner": "Vinod" + }, + "tags_all": { + "Name": "EIP", + "Owner": "Vinod" + }, + "timeouts": null, + "vpc": true + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiZGVsZXRlIjoxODAwMDAwMDAwMDAsInJlYWQiOjkwMDAwMDAwMDAwMCwidXBkYXRlIjozMDAwMDAwMDAwMDB9fQ==" + } + ] + }, + { + "mode": "managed", + "type": "aws_internet_gateway", + "name": "igw", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "arn": "arn:aws:ec2:us-east-1:458419607076:internet-gateway/igw-088310bb91dd11a7d", + "id": "igw-088310bb91dd11a7d", + "owner_id": "458419607076", + "tags": { + "Name": "IGW", + "owner": "vinod" + }, + "tags_all": { + "Name": "IGW", + "owner": "vinod" + }, + "timeouts": null, + "vpc_id": "vpc-0f75836ee7c86c9aa" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19", + "dependencies": [ + "aws_vpc.mycustomvpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_nat_gateway", + "name": "nat", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "allocation_id": "eipalloc-0dec4e7657e6f0c73", + "association_id": "eipassoc-06e6ec3f3093f4c88", + "connectivity_type": "public", + "id": "nat-0018a52afaafb9f96", + "network_interface_id": "eni-06120f8892dde34cf", + "private_ip": "10.0.3.98", + "public_ip": "34.239.9.241", + "secondary_allocation_ids": null, + "secondary_private_ip_address_count": 0, + "secondary_private_ip_addresses": [], + "subnet_id": "subnet-0fa01d974a4407e26", + "tags": { + "Name": "NAT Gateway", + "Owner": "Vinod" + }, + "tags_all": { + "Name": "NAT Gateway", + "Owner": "Vinod" + }, + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTgwMDAwMDAwMDAwMCwidXBkYXRlIjo2MDAwMDAwMDAwMDB9fQ==", + "dependencies": [ + "aws_eip.nat", + "aws_internet_gateway.igw", + "aws_subnet.public-us-east-1a", + "aws_vpc.mycustomvpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_route_table", + "name": "privateroute", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "arn": "arn:aws:ec2:us-east-1:458419607076:route-table/rtb-05f23dd2cd83ea85a", + "id": "rtb-05f23dd2cd83ea85a", + "owner_id": "458419607076", + "propagating_vgws": [], + "route": [ + { + "carrier_gateway_id": "", + "cidr_block": "0.0.0.0/0", + "core_network_arn": "", + "destination_prefix_list_id": "", + "egress_only_gateway_id": "", + "gateway_id": "", + "ipv6_cidr_block": "", + "local_gateway_id": "", + "nat_gateway_id": "nat-0018a52afaafb9f96", + "network_interface_id": "", + "transit_gateway_id": "", + "vpc_endpoint_id": "", + "vpc_peering_connection_id": "" + } + ], + "tags": { + "Name": "private" + }, + "tags_all": { + "Name": "private" + }, + "timeouts": null, + "vpc_id": "vpc-0f75836ee7c86c9aa" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJ1cGRhdGUiOjEyMDAwMDAwMDAwMH19", + "dependencies": [ + "aws_eip.nat", + "aws_internet_gateway.igw", + "aws_nat_gateway.nat", + "aws_subnet.public-us-east-1a", + "aws_vpc.mycustomvpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_route_table", + "name": "publicroute", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "arn": "arn:aws:ec2:us-east-1:458419607076:route-table/rtb-03ab2291f0acd446b", + "id": "rtb-03ab2291f0acd446b", + "owner_id": "458419607076", + "propagating_vgws": [], + "route": [ + { + "carrier_gateway_id": "", + "cidr_block": "0.0.0.0/0", + "core_network_arn": "", + "destination_prefix_list_id": "", + "egress_only_gateway_id": "", + "gateway_id": "igw-088310bb91dd11a7d", + "ipv6_cidr_block": "", + "local_gateway_id": "", + "nat_gateway_id": "", + "network_interface_id": "", + "transit_gateway_id": "", + "vpc_endpoint_id": "", + "vpc_peering_connection_id": "" + } + ], + "tags": { + "Name": "public" + }, + "tags_all": { + "Name": "public" + }, + "timeouts": null, + "vpc_id": "vpc-0f75836ee7c86c9aa" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJ1cGRhdGUiOjEyMDAwMDAwMDAwMH19", + "dependencies": [ + "aws_internet_gateway.igw", + "aws_vpc.mycustomvpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_route_table_association", + "name": "privateassociation_a", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "gateway_id": "", + "id": "rtbassoc-04dfc37a17834fe61", + "route_table_id": "rtb-05f23dd2cd83ea85a", + "subnet_id": "subnet-03bca1e66e34483ac", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJ1cGRhdGUiOjEyMDAwMDAwMDAwMH19", + "dependencies": [ + "aws_eip.nat", + "aws_internet_gateway.igw", + "aws_nat_gateway.nat", + "aws_route_table.privateroute", + "aws_subnet.private-us-east-1a", + "aws_subnet.public-us-east-1a", + "aws_vpc.mycustomvpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_route_table_association", + "name": "privateassociation_b", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "gateway_id": "", + "id": "rtbassoc-07529e65f3f89e88a", + "route_table_id": "rtb-05f23dd2cd83ea85a", + "subnet_id": "subnet-03a9d74e9339d2434", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJ1cGRhdGUiOjEyMDAwMDAwMDAwMH19", + "dependencies": [ + "aws_eip.nat", + "aws_internet_gateway.igw", + "aws_nat_gateway.nat", + "aws_route_table.privateroute", + "aws_subnet.private-us-east-1b", + "aws_subnet.public-us-east-1a", + "aws_vpc.mycustomvpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_route_table_association", + "name": "publicassociation_a", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "gateway_id": "", + "id": "rtbassoc-0870ae7bc90384420", + "route_table_id": "rtb-03ab2291f0acd446b", + "subnet_id": "subnet-0fa01d974a4407e26", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJ1cGRhdGUiOjEyMDAwMDAwMDAwMH19", + "dependencies": [ + "aws_internet_gateway.igw", + "aws_route_table.publicroute", + "aws_subnet.public-us-east-1a", + "aws_vpc.mycustomvpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_route_table_association", + "name": "publicassociation_b", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "gateway_id": "", + "id": "rtbassoc-0de18ab0cf25e5c3a", + "route_table_id": "rtb-03ab2291f0acd446b", + "subnet_id": "subnet-0bd01bd3dcc7c2b28", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJ1cGRhdGUiOjEyMDAwMDAwMDAwMH19", + "dependencies": [ + "aws_internet_gateway.igw", + "aws_route_table.publicroute", + "aws_subnet.public-us-east-1b", + "aws_vpc.mycustomvpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_subnet", + "name": "private-us-east-1a", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "arn": "arn:aws:ec2:us-east-1:458419607076:subnet/subnet-03bca1e66e34483ac", + "assign_ipv6_address_on_creation": false, + "availability_zone": "us-east-1a", + "availability_zone_id": "use1-az4", + "cidr_block": "10.0.1.0/24", + "customer_owned_ipv4_pool": "", + "enable_dns64": false, + "enable_lni_at_device_index": 0, + "enable_resource_name_dns_a_record_on_launch": false, + "enable_resource_name_dns_aaaa_record_on_launch": false, + "id": "subnet-03bca1e66e34483ac", + "ipv6_cidr_block": "", + "ipv6_cidr_block_association_id": "", + "ipv6_native": false, + "map_customer_owned_ip_on_launch": false, + "map_public_ip_on_launch": false, + "outpost_arn": "", + "owner_id": "458419607076", + "private_dns_hostname_type_on_launch": "ip-name", + "tags": { + "Name": "Private Subnet", + "subnet": "private-us-east-1a" + }, + "tags_all": { + "Name": "Private Subnet", + "subnet": "private-us-east-1a" + }, + "timeouts": null, + "vpc_id": "vpc-0f75836ee7c86c9aa" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9", + "dependencies": [ + "aws_vpc.mycustomvpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_subnet", + "name": "private-us-east-1b", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "arn": "arn:aws:ec2:us-east-1:458419607076:subnet/subnet-03a9d74e9339d2434", + "assign_ipv6_address_on_creation": false, + "availability_zone": "us-east-1b", + "availability_zone_id": "use1-az6", + "cidr_block": "10.0.2.0/24", + "customer_owned_ipv4_pool": "", + "enable_dns64": false, + "enable_lni_at_device_index": 0, + "enable_resource_name_dns_a_record_on_launch": false, + "enable_resource_name_dns_aaaa_record_on_launch": false, + "id": "subnet-03a9d74e9339d2434", + "ipv6_cidr_block": "", + "ipv6_cidr_block_association_id": "", + "ipv6_native": false, + "map_customer_owned_ip_on_launch": false, + "map_public_ip_on_launch": false, + "outpost_arn": "", + "owner_id": "458419607076", + "private_dns_hostname_type_on_launch": "ip-name", + "tags": { + "Name": "Private Subnet", + "subnet": "private-us-east-1b" + }, + "tags_all": { + "Name": "Private Subnet", + "subnet": "private-us-east-1b" + }, + "timeouts": null, + "vpc_id": "vpc-0f75836ee7c86c9aa" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9", + "dependencies": [ + "aws_vpc.mycustomvpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_subnet", + "name": "public-us-east-1a", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "arn": "arn:aws:ec2:us-east-1:458419607076:subnet/subnet-0fa01d974a4407e26", + "assign_ipv6_address_on_creation": false, + "availability_zone": "us-east-1a", + "availability_zone_id": "use1-az4", + "cidr_block": "10.0.3.0/24", + "customer_owned_ipv4_pool": "", + "enable_dns64": false, + "enable_lni_at_device_index": 0, + "enable_resource_name_dns_a_record_on_launch": false, + "enable_resource_name_dns_aaaa_record_on_launch": false, + "id": "subnet-0fa01d974a4407e26", + "ipv6_cidr_block": "", + "ipv6_cidr_block_association_id": "", + "ipv6_native": false, + "map_customer_owned_ip_on_launch": false, + "map_public_ip_on_launch": true, + "outpost_arn": "", + "owner_id": "458419607076", + "private_dns_hostname_type_on_launch": "ip-name", + "tags": { + "Name": "Public Subnet", + "subnet": "public-us-east-1a" + }, + "tags_all": { + "Name": "Public Subnet", + "subnet": "public-us-east-1a" + }, + "timeouts": null, + "vpc_id": "vpc-0f75836ee7c86c9aa" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9", + "dependencies": [ + "aws_vpc.mycustomvpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_subnet", + "name": "public-us-east-1b", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "arn": "arn:aws:ec2:us-east-1:458419607076:subnet/subnet-0bd01bd3dcc7c2b28", + "assign_ipv6_address_on_creation": false, + "availability_zone": "us-east-1b", + "availability_zone_id": "use1-az6", + "cidr_block": "10.0.4.0/24", + "customer_owned_ipv4_pool": "", + "enable_dns64": false, + "enable_lni_at_device_index": 0, + "enable_resource_name_dns_a_record_on_launch": false, + "enable_resource_name_dns_aaaa_record_on_launch": false, + "id": "subnet-0bd01bd3dcc7c2b28", + "ipv6_cidr_block": "", + "ipv6_cidr_block_association_id": "", + "ipv6_native": false, + "map_customer_owned_ip_on_launch": false, + "map_public_ip_on_launch": true, + "outpost_arn": "", + "owner_id": "458419607076", + "private_dns_hostname_type_on_launch": "ip-name", + "tags": { + "Name": "Public Subnet", + "subnet": "public-us-east-1b" + }, + "tags_all": { + "Name": "Public Subnet", + "subnet": "public-us-east-1b" + }, + "timeouts": null, + "vpc_id": "vpc-0f75836ee7c86c9aa" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9", + "dependencies": [ + "aws_vpc.mycustomvpc" + ] + } + ] + }, + { + "mode": "managed", + "type": "aws_vpc", + "name": "mycustomvpc", + "provider": "provider[\"registry.opentofu.org/hashicorp/aws\"]", + "instances": [ + { + "schema_version": 1, + "attributes": { + "arn": "arn:aws:ec2:us-east-1:458419607076:vpc/vpc-0f75836ee7c86c9aa", + "assign_generated_ipv6_cidr_block": false, + "cidr_block": "10.0.0.0/16", + "default_network_acl_id": "acl-0d154a4490e56ad7e", + "default_route_table_id": "rtb-0239fb174935a2e25", + "default_security_group_id": "sg-05e5a80f7c4662f97", + "dhcp_options_id": "dopt-077b1d9ea0f5fb912", + "enable_dns_hostnames": true, + "enable_dns_support": true, + "enable_network_address_usage_metrics": false, + "id": "vpc-0f75836ee7c86c9aa", + "instance_tenancy": "default", + "ipv4_ipam_pool_id": null, + "ipv4_netmask_length": null, + "ipv6_association_id": "", + "ipv6_cidr_block": "", + "ipv6_cidr_block_network_border_group": "", + "ipv6_ipam_pool_id": "", + "ipv6_netmask_length": 0, + "main_route_table_id": "rtb-0239fb174935a2e25", + "owner_id": "458419607076", + "tags": { + "Name": "my custom VPC", + "owner": "vinod" + }, + "tags_all": { + "Name": "my custom VPC", + "owner": "vinod" + } + }, + "sensitive_attributes": [], + "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ==" + } + ] + } + ], + "check_results": null +} diff --git a/iac/aws/terraform/creating-custom-vpc/terraform.tfstate.backup b/iac/aws/terraform/creating-custom-vpc/terraform.tfstate.backup new file mode 100644 index 0000000..a000e9a --- /dev/null +++ b/iac/aws/terraform/creating-custom-vpc/terraform.tfstate.backup @@ -0,0 +1,9 @@ +{ + "version": 4, + "terraform_version": "1.7.0", + "serial": 9, + "lineage": "69ea60e4-e317-8e43-6a2c-43fc92d249d3", + "outputs": {}, + "resources": [], + "check_results": null +}