Terraform template to bootstrap a baseline account on AWS.
| Feature | Description | File |
|---|---|---|
| VPC | AWS VPC in the default region | vpc.tf |
| Subnets | Public and private subnets across 3 AZ's in the default region | vpc.tf |
| NAT Gateway | NAT Gateway with static IP in the default region | vpc.tf |
| Budgets | Budget alert, defaults to 100 USD | budget.tf |
| IAM | Assigns defined roles to IAM users across 3 levels admin, dev and basic |
iam.tf |
| CI/CD | GitHub Actions to lint, plan, and apply to AWS |
.github/workflows/terraform-apply.yaml, .github/workflows/terraform-plan.yaml |
DO NOT FORK this is meant to be used from Use this template feature.
- Click on Use this template
- Give a name to your repo
- Wait until the first run of CI finishes
(Github Actions will process the template and commit to your new repo) - Clone your new repo.
- Update
provider.tfwith yourbackendinfo. - If you don't want CI/CD (GitHub Actions), delete
.github/workflows/terraform-apply.yamland.github/workflows/terraform-plan.yaml - If you want CI/CD (GitHub Actions):
On the new repositorysettings->secretsadd yourAWS_REGION,AWS_ROLE_TO_ASSUMEandTERRAFORM_PLAN_BUCKET(to store plan files).
Toplan, create afeature branchand raise aPRtomain.
Toapply, merge thePRintomain(note theapplyjob runs against thefeature branch).
A terraform module to set upOIDCfor GitHub Actions is available here.
NOTE: WAIT until first CI run on github actions before cloning your new project.
| Name | Version |
|---|---|
| aws | ~> 5.0 |
| Name | Version |
|---|---|
| aws | ~> 5.0 |
| random | n/a |
| Name | Description | Type | Required |
|---|---|---|---|
| admin_user_iam_policies | Admin user IAM policies | list(string) |
no |
| admin_users | IAM users (username) to add to the Admins group. |
list(string) |
no |
| assume_role_arn | AWS role to assume when provisioning resources | string |
no |
| basic_user_iam_policies | Basic user IAM policies | list(string) |
no |
| basic_users | IAM users (username) to add to the Viewers group. |
list(string) |
no |
| budget_alert_emails | n/a | list(string) |
no |
| budget_alert_thresholds | What points (percentage) should billing alerts be sent | list(number) |
no |
| budget_currency | The 3-letter currency code as defined in ISO 4217 | string |
no |
| dev_user_iam_policies | Dev user IAM policies | list(string) |
no |
| dev_users | IAM users (username) to add to the Developers group. |
list(string) |
no |
| environment | Current Environment | string |
no |
| monthly_budget | Monthly budget | string |
no |
| prefix | Prefix to prepend to resources (for easy identification). | string |
no |
| region | Default AWS region. | string |
no |
| tags | Common Tags | map(string) |
no |
| Name | Description |
|---|---|
| vpc_id | VPC ID |