@cryptotaxi247 / infra / commits / 952f53d9

terraform: update readme and tf.sh wrapper

Jörg Thalheim committed Aug 18, 2024 at 08:32 UTC 952f53d907b318662c0b56e3addc685b661577fa
2 files changed +13 -11
terraform/README.md
+6 -11
@@ -21,26 +21,21 @@ Run `aws sso login` to acquire a temporary token.
21
22 ## Usage
23
24 -The first time the following command has to be run to initialize the state
25 -file and plugins:
26 -
27 -```sh
28 -terraform init
29 -```
24 +We use opentofu, which is a fork of https://www.terraform.io/ maintained by the Linux foundation.
25
26 Then run the following command to diff the changes and then apply if approved:
27
28 ```sh
34 -terraform apply
29 +./tf.sh apply
30 ```
31
32 ## Terraform workflow
33
39 -Write the Terraform code and test the changes using `terraform validate`.
34 +Write the Tofu code and test the changes using `./tf.sh validate`.
35
41 -Before committing run `terraform fmt`.
36 +Before committing run `nix fmt`.
37
38 Once the code is ready to be deployed, create a new PR with the attached
44 -output of `terraform plan`.
39 +output of `./tf.sh plan`.
40
46 -Once the PR is merged, run `terraform apply` to apply the changes.
41 +Once the PR is merged, run `./tf.sh apply` to apply the changes.
terraform/tf.sh new
+7
@@ -0,0 +1,7 @@
1 +#!/usr/bin/env bash
2 +set -euo pipefail
3 +
4 +cd "$(dirname "$0")"
5 +rm -f .terraform.lock.hcl
6 +tofu init
7 +tofu "$@"