Following aws vpc course from https://github.com/Lowess
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
art.dambrine 94364bcfb7 refacto vpc 4 years ago
docs init commit 4 years ago
.gitignore init commit 4 years ago
.pre-commit-config.yaml init commit 4 years ago
.terraform.lock.hcl 1st part TP ok 4 years ago
README.md init commit 4 years ago
TP Terraform - AWS.md 1st part TP ok 4 years ago
main.tf refacto vpc 4 years ago
outputs.tf part 2 4 years ago
variables.tf refacto vpc 4 years ago
versions.tf init commit 4 years ago

README.md

Terraform AWS VPC

📦 Install Terraform

Install Terraform by following the documentation

Make sure terraform is working properly

$ terraform
Usage: terraform [--version] [--help] <command> [args]

The available commands for execution are listed below.
The most common, useful commands are shown first, followed by
less common or more advanced commands. If you're just getting
started with Terraform, stick with the common commands. For the
other commands, please read the help and docs before usage.

Common commands:
    apply              Builds or changes infrastructure
    console            Interactive console for Terraform interpolations
# ...

Based on standard module structure guidelines

📐 Naming Convention

Common variables referenced in naming standards

Variable RegExp Example
<availability_zone> [a-z]{2}-[a-z]{1,}-[1-2][a-f] us-east-1a, us-west-2c, eu-west-1a, ap-northeast-1c

AWS - Resource Naming Standards

AWS Resource Resource Naming Comment Example
VPC <vpc_name>-vpc mycloud-vpc
Subnets <vpc_name>-private-<availability_zone> mycloud-private-us-east-1b
<vpc_name>-public-<availability_zone> mycloud-public-us-east-1b
Route Tables <vpc_name>-private-<availability_zone> mycloud-private-us-east-1b
<vpc_name>-public mycloud-public
Internet Gateway <vpc_name>-igw mycloud-igw
Nat Gateway <vpc_name>-nat-<availability_zone> mycloud-nat-us-east-1b

1. Create a VPC

The really first stage for bootstrapping an AWS account is to create a VPC

VPC AZs

2. Create public and private Subnets

Then create public and private subnets in each AZs (us-east-1a, us-east-1b, us-east-1c)

VPC AZs Subnets

3. Create internet and nat Gateways

Create one internet gateway so that the VPC can communicate with the outisde world. For instances located in private subnets, we will need NAT instances to be setup in each availability zones

VPC AZs Subnets GW

4. Create route tables and routes

Finaly, link the infrastructure together by creating route tables and routes so that servers from public and private subnets can send their traffic to the respective gateway, either the internet gateway or the NAT ones.

VPC AZs Subnets GW Routes