This repository contains the Terraform code to generate a Virtual Private Cloud (VPC) and Elastic Kubernetes Cluster in Amazon Web Services. The default region is us-east-2. State is stored in an S3 bucket with a locking DynamoDB table.
This code provsiions several resources when used. They include:
- Virtual Private Cloud (VPC)
- 3 Public Subnets
- 3 Private Subnets
- NAT Gateway
- Internet Gateway
- Elastic Kubernetes Service (EKS) Cluster
- 2 EKS Node Groups, backed by AutoScaling Groups
- Default Security Group
- Route Table for Private Subnets
The projected infrastructure costs for this workload is $133.34 per month.
- Clone the repository.
- In AWS, create a DynamoDB table. Use
LockID
for the partition key. - In AWS, create an S3 bucket to store Terraform state.
- Modify lines 34 - 37 in
teraform.tf
to match the name of your S3 bucket and DyanmoDB table. - Modify the varialbes in
variables.tf
to match your region and other settings. - Run
terraform init
to initialize Terraform. - Run
terraform apply
to launch the infrastructure. - Run
terraform destroy
to dear down the infrastructure when you are done.
Merges and pushes to the main branch of this repository will initiate a build using
GitHub Actions. The workflow runs several
terraform commands: terraform init
, terraform plan
, then terraform apply
.