{"id":15664756,"url":"https://github.com/nozaq/terraform-aws-secure-vpc","last_synced_at":"2025-05-06T19:29:27.097Z","repository":{"id":32262467,"uuid":"132091617","full_name":"nozaq/terraform-aws-secure-vpc","owner":"nozaq","description":"A terraform module to create a VPC with secure default configurations.","archived":false,"fork":false,"pushed_at":"2022-01-18T13:23:25.000Z","size":34,"stargazers_count":17,"open_issues_count":1,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T02:11:52.386Z","etag":null,"topics":["aws","aws-auditing","cis-benchmark","devops","hardening","security","security-hardening","security-tools","terraform","vpc"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nozaq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-04T05:27:45.000Z","updated_at":"2024-10-14T20:46:06.000Z","dependencies_parsed_at":"2022-08-07T17:15:43.225Z","dependency_job_id":null,"html_url":"https://github.com/nozaq/terraform-aws-secure-vpc","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nozaq%2Fterraform-aws-secure-vpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nozaq%2Fterraform-aws-secure-vpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nozaq%2Fterraform-aws-secure-vpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nozaq%2Fterraform-aws-secure-vpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nozaq","download_url":"https://codeload.github.com/nozaq/terraform-aws-secure-vpc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252752772,"owners_count":21798849,"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","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","aws-auditing","cis-benchmark","devops","hardening","security","security-hardening","security-tools","terraform","vpc"],"created_at":"2024-10-03T13:44:05.092Z","updated_at":"2025-05-06T19:29:27.072Z","avatar_url":"https://github.com/nozaq.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-aws-secure-vpc\n\n[![Github Actions](https://github.com/nozaq/terraform-aws-secure-vpc/workflows/Terraform/badge.svg)](https://github.com/nozaq/terraform-aws-secure-vpc/actions?workflow=Terraform)\n\n[Terraform Module Registry](https://registry.terraform.io/modules/nozaq/secure-vpc/aws)\n\nA terraform module to create a VPC with secure default configurations.\nMost configurations are based on [CIS Amazon web Services Foundations] and [CIS Amazon Web Services Three-tier Web Architecture Benchmark].\n\nThe primary goal of this module is to create a VPC itself in a secure manner without any boilerplate code hence it does not create any subnets except ones for NAT Gateways.\n\n## Features\n\n- Disable insecure default configurations, e.g. denying all traffic in the default security group etc.\n- Enable VPC Flow Logs to monitor all traffic type.\n- Create NAT Gateways in each availability zones with the dedicated subnets and Network ACL rules.\n- Create route tables for public/private subnets and set the private settings as default.\n\n## Usage\n\n```hcl\ndata \"aws_caller_identity\" \"current\" {}\n\nmodule \"secure_vpc\" {\n  source = \"nozaq/secure-vpc/aws\"\n\n  aws_account_id          = data.aws_caller_identity.current.account_id\n  cidr_block              = \"10.0.0.0/8\"\n  availability_zones      = [\"ap-northeast-1a\", \"ap-northeast-1c\"]\n  nat_subnet_cidr_blocks  = [\"10.0.253.0/24\", \"10.0.254.0/24\"]\n  flow_logs_iam_role_name = \"FlowLogsPublisher\"\n  flow_logs_group_name    = \"SimpleVPCFlowLogs\"\n\n  tags = {\n    Environment = \"SimpleVPC\"\n  }\n}\n```\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|:----:|:-----:|:-----:|\n| assign\\_generated\\_ipv6\\_cidr\\_block | Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. | string | `\"false\"` | no |\n| availability\\_zones | The availability zones to support with this VPC. | list | `[]` | no |\n| aws\\_account\\_id | The AWS Account ID number of the account. | string | n/a | yes |\n| cidr\\_block | The CIDR block for the VPC. | string | n/a | yes |\n| enable\\_dns\\_hostnames | A boolean flag to enable/disable DNS hostnames in the VPC. | string | `\"false\"` | no |\n| enable\\_dns\\_support | A boolean flag to enable/disable DNS support in the VPC. | string | `\"true\"` | no |\n| flow\\_logs\\_group\\_name | The name of the CloudWatch Logs group for VPC Flow Logs. | string | n/a | yes |\n| flow\\_logs\\_iam\\_role\\_name | The name of the IAM role to publish VPC Flow Logs. | string | n/a | yes |\n| flow\\_logs\\_key\\_deletion\\_window\\_in\\_days | Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 30 days. | string | `\"30\"` | no |\n| flow\\_logs\\_retention\\_in\\_days | Specifies the number of days you want to retain VPC Flow Logs events. | string | `\"0\"` | no |\n| flow\\_logs\\_traffic\\_type | The type of traffic to capture. Valid values: ACCEPT,REJECT, ALL | string | `\"ALL\"` | no |\n| instance\\_tenancy | A tenancy option for instances launched into the VPC | string | `\"default\"` | no |\n| nat\\_subnet\\_cidr\\_blocks | The CIDR blocks for the NAT subnets. | list | `[]` | no |\n| tags | Tags to be attached to all resources created with this module. | map | `{}` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| default\\_network\\_acl\\_id | The ID of the default network ACL |\n| default\\_route\\_table\\_id | The ID of the default route table |\n| default\\_security\\_group\\_id | The ID of the security group created by default on VPC creation |\n| flow\\_logs\\_group\\_arn | The ARN of the CloudWatch log group to which VPC Flow Logs will publish to. |\n| internet\\_gateway\\_id | The ID of the internet gateawy |\n| nat\\_gateway\\_ids | The ID of the NAT Gateawy |\n| nat\\_gateway\\_private\\_ips | The private IP address of the NAT Gateway |\n| nat\\_gateway\\_public\\_ips | The public IP address of the NAT Gateway |\n| private\\_route\\_table\\_id | The ID of the route table for private subnets |\n| public\\_route\\_table\\_id | The ID of the route table for public subnets |\n| vpc\\_cidr\\_block | The CIDR block of the VPC |\n| vpc\\_enable\\_dns\\_hostnames | Whether or not the VPC has DNS hostname support |\n| vpc\\_enable\\_dns\\_support | Whether or not the VPC has DNS support |\n| vpc\\_id | The ID of the VPC |\n| vpc\\_instance\\_tenancy | Tenancy of instances spin up within VPC |\n| vpc\\_main\\_route\\_table\\_id | The ID of the main route table associated with this VPC |\n\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n\n[CIS Amazon Web Services Foundations]: https://d0.awsstatic.com/whitepapers/compliance/AWS_CIS_Foundations_Benchmark.pdf\n[CIS Amazon Web Services Three-tier Web Architecture Benchmark]: https://d1.awsstatic.com/whitepapers/compliance/CIS_Amazon_Web_Services_Three-tier_Web_Architecture_Benchmark.pdf","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnozaq%2Fterraform-aws-secure-vpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnozaq%2Fterraform-aws-secure-vpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnozaq%2Fterraform-aws-secure-vpc/lists"}