Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erwan-simon/aws-network-stack
Terraform stack allowing you to deploy a full network stack on AWS, including public, private and intra subnets with Internet and NAT gateways.
https://github.com/erwan-simon/aws-network-stack
aws internet-gateway nat-gateway network subnet terraform vpc
Last synced: 18 days ago
JSON representation
Terraform stack allowing you to deploy a full network stack on AWS, including public, private and intra subnets with Internet and NAT gateways.
- Host: GitHub
- URL: https://github.com/erwan-simon/aws-network-stack
- Owner: erwan-simon
- License: mit
- Created: 2025-01-13T09:37:32.000Z (30 days ago)
- Default Branch: main
- Last Pushed: 2025-01-13T09:39:45.000Z (30 days ago)
- Last Synced: 2025-01-13T10:35:11.198Z (30 days ago)
- Topics: aws, internet-gateway, nat-gateway, network, subnet, terraform, vpc
- Language: HCL
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS Network Stack
This Terraform stack creates the network configuration needed for your day to day cloud projects.
**WARNING: some elements of this stack COST MONEY as long as they are deployed, do not forget to destroy them when not needed. See dedicated chapter in this documentation**
## Prerequisites
* Terraform (tested with version `v1.5.7`)
## General presentation
This configuration is composed of multiple elements :
- a VPC
- 3 groups of subnets :
- public subnets : which cas be accessed from internet (resources created in this subnet by default are affected with a public IP address) and can access internet (with the Internet Gateway created in those subnets)
- private subnets : which can access internet using the NAT Gateway created in the public subnet but cannot be accessed from the internet (resources in it are not created with a public IP address by default)
- intra subnets : resources created in this subnet cannot access internet and cannot be accessed from the internet
- an Internet Gateway : resource allowing the public and private subnets to have access to the internet
- a NAT Gateway : resource located in the public subnet allowing the private subnets to have access to the internetThis repository creates by default only one NAT Gateway and only one private subnet, you can add more private subnet by uncommenting the relevant CIDR in the [terraform/variables.tf](terraform/variables.tf) file.
## Deployment
```bash
cd terraform
terraform init
terraform workspace new prod
terraform apply
```## Destroy resources that cost money
You can destroy the NAT gateway and the Elastic IP when you are not using the Internet Egress capabilities of the private subnets of this network stack.
```bash
cd terraform
terraform init
terraform workspace select prod
terraform destroy -target aws_nat_gateway.instances -target aws_eip.nat_eips
```