| 1 | # User & permission management |
| 2 | |
| 3 | This module is for superadmins in the team. |
| 4 | |
| 5 | This terraform root module manages: |
| 6 | |
| 7 | - IAM roles |
| 8 | - fastly log module |
| 9 | - infrastructure for archeologist team |
| 10 | - Webhooks for the Cache bucket as our terraform code is awkwardly split and it |
| 11 | requires iam:PassRole |
| 12 | |
| 13 | ## Setup |
| 14 | |
| 15 | In order to use this, make sure to install direnv and Nix with flakes enabled. |
| 16 | |
| 17 | Then run `direnv allow` to load the environment with the runtime dependencies. |
| 18 | |
| 19 | Run `aws sso login` to acquire a temporary token. |
| 20 | |
| 21 | ## Usage |
| 22 | |
| 23 | We use opentofu, which is a fork of https://www.terraform.io/ maintained by the |
| 24 | Linux foundation. |
| 25 | |
| 26 | Then run the following command to diff the changes and then apply if approved: |
| 27 | |
| 28 | ```sh |
| 29 | ./tf.sh apply |
| 30 | ``` |
| 31 | |
| 32 | ## Terraform workflow |
| 33 | |
| 34 | Write the Tofu code and test the changes using `./tf.sh validate`. |
| 35 | |
| 36 | Before committing run `nix fmt`. |
| 37 | |
| 38 | Once the code is ready to be deployed, create a new PR with the attached output |
| 39 | of `./tf.sh plan`. |
| 40 | |
| 41 | Once the PR is merged, run `./tf.sh apply` to apply the changes. |