This project deploys the basic resources necessary for running multi-user Terraform deployments on an AWS account.
Go to file
2024-05-17 23:45:25 +06:00
.gitignore add resources 2023-11-06 17:16:36 +06:00
.terraform-docs.yml add terraform-docs config 2024-05-17 23:44:27 +06:00
.terraform-version add resources 2023-11-06 17:16:36 +06:00
.terraform.lock.hcl add resources 2023-11-06 17:16:36 +06:00
aws.data.tf add resources 2023-11-06 17:16:36 +06:00
aws.dynamodb.tf add resources 2023-11-06 17:16:36 +06:00
aws.iam.tf add resources 2023-11-06 17:16:36 +06:00
aws.kms.tf add resources 2023-11-06 17:16:36 +06:00
aws.s3.tf add resources 2023-11-06 17:16:36 +06:00
aws.ssm.tf add resources 2023-11-06 17:16:36 +06:00
LICENSE add license 2023-11-06 15:35:39 +06:00
README.md add resources 2023-11-06 17:16:36 +06:00
README.terraform.md add resources 2023-11-06 17:16:36 +06:00
terraform.meta.tf add resources 2023-11-06 17:16:36 +06:00
terraform.outputs.tf add resources 2023-11-06 17:16:36 +06:00
terraform.tfvars.sample run terraform fmt 2024-05-17 23:45:25 +06:00
terraform.variables.tf run terraform fmt 2024-05-17 23:45:25 +06:00

Terraform AWS Pre-Base

Intro

This project deploys the basic resources necessary for running multi-user Terraform deployments on an AWS account.

  • an s3 bucket for storing terraform states
  • a dynamodb table for maintaining terraform locks
  • an admin user intended for use in other IaC projects
  • a kms key intended for securing other IaC project secrets
  • a parameter store tree to keep outputs of this project for reference

This configuration is intended to be manually executed once at the beginning by the root user.

⚠️ Re-deploying this project again after running other AWS IaC projects can be extremely destructive.

Usage

  1. Install terraform or opentofu (preferably with tfenv). The required version is stated in terraform.meta.tf.

  2. Install terraform dependencies:

    terraform init -upgrade
    
  3. Insert org-specific variable values in <org-name>.tfvars. See *.tfvars.sample for example.

  4. Then execute as:

    terraform apply -var-file=<org-name>.tfvars
    

Notes

The terraform state is not saved in s3, because it is assumed that no s3 bucket for terraform states exists yet. User should secure the state file using some other method.

Generated outputs are saved in a parameter store tree for future reference.