Skip to main content

Add a README for terraform

ID
8349e53
date
2023-05-01 06:55:13+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
b80579f
message
Add a README for `terraform`
changed files
1 file, 33 additions

Changed files

terraform/README.md (0) → terraform/README.md (1144)

diff --git a/terraform/README.md b/terraform/README.md
new file mode 100644
index 0000000..ca17787
--- /dev/null
+++ b/terraform/README.md
@@ -0,0 +1,33 @@
+# terraform
+
+These scripts are all aliases around [Terraform], the infrastructure-as-code tool we use at work.
+
+In some of our Terraform configurations, we use wrapper scripts `run_terraform.sh` instead of invoking `terraform` directly.
+This wrapper script fetches API keys for the [Elastic Cloud] and [Auth0] providers, so we don't have to hard-code them or store them locally.
+Something like:
+
+```console
+EC_API_KEY=$(aws secretsmanager get-secret-value \
+  --secret-id "elastic_cloud/api_key" \
+  --output text \
+  --query "SecretString")
+
+EC_API_KEY="$EC_API_KEY" terraform "$@"
+```
+
+My `tf` scripts will choose whether to run a wrapper script or vanilla `terraform`, so I don't have to think about it.
+
+My scripts are:
+
+<dl>
+  <dt>
+    <code>tf</code>
+  </dt>
+  <dd>
+    runs <code>terraform</code> (or the wrapper script) with any arguments supplied.
+  </dd>
+</dl>
+
+[Terraform]: https://www.terraform.io/
+[Elastic Cloud]: https://registry.terraform.io/providers/elastic/ec/latest/docs#using-your-api-key-on-the-elastic-cloud-terraform-provider
+[Auth0]: https://registry.terraform.io/providers/auth0/auth0/latest/docs#environment-variables
\ No newline at end of file