Add my Terraform shell aliases
- ID
b97a6a9- date
2022-03-19 09:17:45+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
70dedac- message
Add my Terraform shell aliases- changed files
Changed files
tfa (0) → tfa (585)
diff --git a/tfa b/tfa
new file mode 100755
index 0000000..9860e6d
--- /dev/null
+++ b/tfa
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+# In some of the Wellcome Terraform projects, we invoke Terraform via
+# a wrapper script. This fetches extra credentials from Secrets Manager,
+# e.g. our Auth0 API tokens, and passes them to Terraform as env vars.
+#
+# This is one of three scripts (`tfi`, `tfp`, `tfa`) which do the
+# boring work of checking whether a project uses a wrapper script, or
+# whether to invoke Terraform directly.
+#
+# This is an alias for "terraform apply".
+
+if [[ -f run_terraform.sh ]]
+then
+ ./run_terraform.sh apply terraform.plan "$@"
+else
+ terraform apply terraform.plan "$@"
+fi
tfi (0) → tfi (583)
diff --git a/tfi b/tfi
new file mode 100755
index 0000000..9be234f
--- /dev/null
+++ b/tfi
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# In some of the Wellcome Terraform projects, we invoke Terraform via
+# a wrapper script. This fetches extra credentials from Secrets Manager,
+# e.g. our Auth0 API tokens, and passes them to Terraform as env vars.
+#
+# This is one of three scripts (`tfi`, `tfp`, `tfa`) which do the
+# boring work of checking whether a project uses a wrapper script, or
+# whether to invoke Terraform directly.
+#
+# This is an alias for "terraform init".
+
+set -o errexit
+set -o nounset
+
+if [[ -f run_terraform.sh ]]
+then
+ ./run_terraform.sh init "$@"
+else
+ terraform init "$@"
+fi
tfp (0) → tfp (592)
diff --git a/tfp b/tfp
new file mode 100755
index 0000000..fe98fe3
--- /dev/null
+++ b/tfp
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+# In some of the Wellcome Terraform projects, we invoke Terraform via
+# a wrapper script. This fetches extra credentials from Secrets Manager,
+# e.g. our Auth0 API tokens, and passes them to Terraform as env vars.
+#
+# This is one of three scripts (`tfi`, `tfp`, `tfa`) which do the
+# boring work of checking whether a project uses a wrapper script, or
+# whether to invoke Terraform directly.
+#
+# This is an alias for "terraform plan".
+
+if [[ -f run_terraform.sh ]]
+then
+ ./run_terraform.sh plan -out=terraform.plan "$@"
+else
+ terraform plan -out=terraform.plan "$@"
+fi