Terraform repo for larger-scale AWS demos.
Currently includes the following services:
- VPC
- IAM
- EC2 (with HCP Packer used for AMI references)
- S3
- ECS
- EKS
- ELB
- DynamoDB
The main branch is flat - some public modules are used, but mostly direct resource references, and intentionally minimal security/compliance hardening so IaC scanning tools can be demonstrated with a fair number of issues to find.
The security-fix branch shows the same resources but with security findings fixed (currently based on Checkov scans).
Over time I'll add more branches to show refactoring into local, then TFC private modules.
To use in your own environment, update main.tf to change the Terraform Cloud organization and workspace selection to your own.
Name | Version |
---|---|
terraform | >= 1.3 |
aws | ~> 5.9 |
hcp | ~> 0.82 |
Name | Version |
---|---|
aws | ~> 5.9 |
hcp | ~> 0.82 |
Name | Source | Version |
---|---|---|
bastion_sg | terraform-aws-modules/security-group/aws | ~> 5.1 |
ecs_alb_sg | terraform-aws-modules/security-group/aws | ~> 5.1 |
ecs_nginx_sg | terraform-aws-modules/security-group/aws | ~> 5.1 |
vpc | terraform-aws-modules/vpc/aws | ~> 5.1 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
bastion_packer_bucket | The HCP Packer bucket name for the bastion instance. | string |
n/a | yes |
owner | Name of the person responsible for this deployment. | string |
n/a | yes |
prefix | A prefix for resource names. Will be combined with env to generate unique names. |
string |
n/a | yes |
region | AWS region. | string |
n/a | yes |
bastion_instance_type | EC2 instance type for the bastion instance. | string |
"t3.micro" |
no |
bastion_packer_channel | The HCP Packer channel name for the bastion instance. | string |
"development" |
no |
eks_node_instance_type | EC2 instance type for the EKS nodes. | string |
"t3.medium" |
no |
env | Environment for this deployment. | string |
"dev" |
no |
Name | Description |
---|---|
asset_bucket_name | Name of the S3 bucket for app assets. |
bastion_hostname | Public hostname of the bastion instance. |
eks_endpoint | API endpoint of the EKS cluster. |
frontend_url | URL of the frontend load balancer. |