This is a Terraform module that creates a foundation for AWS. It creates resources like VPC, Subnets, Route Tables, Internet Gateway, NAT Gateway, etc.
- A s3 bucket to store the Terraform state file.
- A DynamoDB table to store the Terraform state lock.
- A Keypair to access the EC2 instances for bastion host (optional).
- Update the
generic-variables.tffile'saws_regionandenvvariables. - Update the s3 bucket name in
provider.tffile. - Update the DynamoDB table name in
provider.tffile. - Update the
bastion_key_namevariable inbastion.auto.tfvarsfile. - Update any other variables in
*.auto.tfvarsfile for the desired inputs. - Run
terraform initto initialize the Terraform. - Run
terraform planto see the changes that will be applied. - Run
terraform applyto apply the changes.
aws_region- The AWS region to deploy the resources.env- default asdev, can also be string likeprod,uatetc..project- default asfsmeaning foundation.module- default astracker.
az_count- default as6, can be any number between1and the number of availability zones in the region.
vpc_cidr- CIDR block for the VPC.subnet_cidr- CIDR block for the subnets.
type = map(list(string))
# should provide a list of CIDR blocks for both public and private subnets
{
public_subnets = [...],
private_subnets = [...]
}