Skip to content

Terraform template to bootstrap a baseline project on AWS.

License

Notifications You must be signed in to change notification settings

braveokafor/terraform-aws-template

Repository files navigation

Terraform AWS Template

Terraform template to bootstrap a baseline account on AWS.

Features

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

Usage

DO NOT FORK this is meant to be used from Use this template feature.

  1. Click on Use this template
  2. Give a name to your repo
  3. Wait until the first run of CI finishes
    (Github Actions will process the template and commit to your new repo)
  4. Clone your new repo.
  5. Update provider.tf with your backend info.
  6. If you don't want CI/CD (GitHub Actions), delete .github/workflows/terraform-apply.yaml and .github/workflows/terraform-plan.yaml
  7. If you want CI/CD (GitHub Actions):
    On the new repository settings->secrets add your AWS_REGION, AWS_ROLE_TO_ASSUME and TERRAFORM_PLAN_BUCKET (to store plan files).
    To plan, create a feature branch and raise a PR to main.
    To apply, merge the PR into main (note the apply job runs against the feature branch).
    A terraform module to set up OIDC for GitHub Actions is available here.

NOTE: WAIT until first CI run on github actions before cloning your new project.

Requirements

Name Version
aws ~> 5.0

Providers

Name Version
aws ~> 5.0
random n/a

Inputs

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

Outputs

Name Description
vpc_id VPC ID

About

Terraform template to bootstrap a baseline project on AWS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published