{"id":23906834,"url":"https://github.com/tks-devops/terraform-project","last_synced_at":"2026-02-11T08:01:17.813Z","repository":{"id":269493563,"uuid":"907586449","full_name":"Tks-Devops/Terraform-project","owner":"Tks-Devops","description":"Terraform Project for AWS Infrastructure..1 VPC ○ 3 public subnets ○ 3 private subnets ○ 3 Private routing tables ○ 1 public routing table ○ 1 internet gateway ○ 3 Elastic IP's for NAT Gateways ○ 3 NAT GateWays","archived":false,"fork":false,"pushed_at":"2024-12-25T12:23:42.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-02T06:33:04.907Z","etag":null,"topics":["aws-ec2","awscli","elastic","elastic-ip-for-nat-gateways","git","github","internet-gateway","linux","nat-gateways","private-routing-table","private-subnets","public-routing-table","public-subnet","shell-script","teraform","vpc","yaml","yaml-configuration"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tks-Devops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-23T23:52:51.000Z","updated_at":"2025-04-02T00:59:43.000Z","dependencies_parsed_at":"2024-12-24T01:24:14.703Z","dependency_job_id":"8c03a445-2e52-4919-8797-19d29d46e6f7","html_url":"https://github.com/Tks-Devops/Terraform-project","commit_stats":null,"previous_names":["tks-devops/terraform-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Tks-Devops/Terraform-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tks-Devops%2FTerraform-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tks-Devops%2FTerraform-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tks-Devops%2FTerraform-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tks-Devops%2FTerraform-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tks-Devops","download_url":"https://codeload.github.com/Tks-Devops/Terraform-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tks-Devops%2FTerraform-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273244306,"owners_count":25070958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-ec2","awscli","elastic","elastic-ip-for-nat-gateways","git","github","internet-gateway","linux","nat-gateways","private-routing-table","private-subnets","public-routing-table","public-subnet","shell-script","teraform","vpc","yaml","yaml-configuration"],"created_at":"2025-01-05T02:14:56.323Z","updated_at":"2026-02-11T08:01:12.765Z","avatar_url":"https://github.com/Tks-Devops.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Project for AWS Infrastructure\n\n## Step 1: Install Terraform\n\nDownload and install Terraform from [terraform.io](https://www.terraform.io/downloads.html).\n\nVerify installation:\n```bash\nterraform --version\n\nStep 2: Create Terraform Files\n\nCreate a new directory for Terraform:\n\nmkdir terraform_project \u0026\u0026 cd terraform_project\n\nCreate main.tf:\n\nnano main.tf\n\nPaste the following configuration:\nHCL\n\nprovider \"aws\" {\n  region = \"us-east-1\"\n}\n\n# Fetch Availability Zones\ndata \"aws_availability_zones\" \"available\" {}\n\n# Create VPC\nresource \"aws_vpc\" \"main\" {\n  cidr_block           = \"10.0.0.0/16\"\n  enable_dns_support   = true\n  enable_dns_hostnames = true\n  tags = {\n    Name = \"main-vpc\"\n  }\n}\n\n# Create Public Subnets\nresource \"aws_subnet\" \"public\" {\n  count                   = 3\n  vpc_id                  = aws_vpc.main.id\n  cidr_block              = cidrsubnet(aws_vpc.main.cidr_block, 8, count.index)\n  availability_zone       = element(data.aws_availability_zones.available.names, count.index)\n  map_public_ip_on_launch = true\n  tags = {\n    Name = \"public-subnet-${count.index + 1}\"\n  }\n}\n\n# Create Private Subnets\nresource \"aws_subnet\" \"private\" {\n  count             = 3\n  vpc_id            = aws_vpc.main.id\n  cidr_block        = cidrsubnet(aws_vpc.main.cidr_block, 8, count.index + 3)\n  availability_zone = element(data.aws_availability_zones.available.names, count.index)\n  tags = {\n    Name = \"private-subnet-${count.index + 1}\"\n  }\n}\n\n# Create Internet Gateway\nresource \"aws_internet_gateway\" \"main\" {\n  vpc_id = aws_vpc.main.id\n  tags = {\n    Name = \"main-internet-gateway\"\n  }\n}\n\n# Create Public Route Table\nresource \"aws_route_table\" \"public\" {\n  vpc_id = aws_vpc.main.id\n  tags = {\n    Name = \"public-route-table\"\n  }\n}\n\n# Add Route to Internet Gateway in Public Route Table\nresource \"aws_route\" \"public_internet_access\" {\n  route_table_id         = aws_route_table.public.id\n  destination_cidr_block = \"0.0.0.0/0\"\n  gateway_id             = aws_internet_gateway.main.id\n}\n\n# Associate Public Subnets with Public Route Table\nresource \"aws_route_table_association\" \"public\" {\n  count          = 3\n  subnet_id      = aws_subnet.public[count.index].id\n  route_table_id = aws_route_table.public.id\n}\n\n# Create Elastic IPs for NAT Gateways\nresource \"aws_eip\" \"nat\" {\n  count = 3\n  vpc   = true\n  tags = {\n    Name = \"nat-eip-${count.index + 1}\"\n  }\n}\n\n# Create NAT Gateways\nresource \"aws_nat_gateway\" \"nat\" {\n  count         = 3\n  allocation_id = aws_eip.nat[count.index].id\n  subnet_id     = aws_subnet.public[count.index].id\n  tags = {\n    Name = \"nat-gateway-${count.index + 1}\"\n  }\n}\n\n# Create Private Route Tables\nresource \"aws_route_table\" \"private\" {\n  count  = 3\n  vpc_id = aws_vpc.main.id\n  tags = {\n    Name = \"private-route-table-${count.index + 1}\"\n  }\n}\n\n# Add Routes to NAT Gateways in Private Route Tables\nresource \"aws_route\" \"private_nat_access\" {\n  count                  = 3\n  route_table_id         = aws_route_table.private[count.index].id\n  destination_cidr_block = \"0.0.0.0/0\"\n  nat_gateway_id         = aws_nat_gateway.nat[count.index].id\n}\n\n# Associate Private Subnets with Private Route Tables\nresource \"aws_route_table_association\" \"private\" {\n  count          = 3\n  subnet_id      = aws_subnet.private[count.index].id\n  route_table_id = aws_route_table.private[count.index].id\n}\n\nInitialize and apply:\nbash\n\nterraform init\nterraform apply\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftks-devops%2Fterraform-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftks-devops%2Fterraform-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftks-devops%2Fterraform-project/lists"}