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.tf
file'saws_region
andenv
variables. - Update the s3 bucket name in
provider.tf
file. - Update the DynamoDB table name in
provider.tf
file. - Update the
bastion_key_name
variable inbastion.auto.tfvars
file. - Update any other variables in
*.auto.tfvars
file for the desired inputs. - Run
terraform init
to initialize the Terraform. - Run
terraform plan
to see the changes that will be applied. - Run
terraform apply
to apply the changes.
aws_region
- The AWS region to deploy the resources.env
- default asdev
, can also be string likeprod
,uat
etc..project
- default asfs
meaning foundation.module
- default astracker
.
az_count
- default as6
, can be any number between1
and 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 = [...]
}