Skip to main content

back to terraform.plan

ID
9d31a1a
date
2023-05-01 07:53:11+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
175dfa5
message
back to terraform.plan
changed files
3 files, 23 additions, 10 deletions

Changed files

terraform/README.md (2770) → terraform/README.md (2776)

diff --git a/terraform/README.md b/terraform/README.md
index 7ef4d5d..49ce415 100644
--- a/terraform/README.md
+++ b/terraform/README.md
@@ -15,7 +15,7 @@ These scripts are all related to [Terraform], the infrastructure-as-code tool we
   <dd>
     alias for <code>terraform</code>
   </dd>
-  
+
   <dt>
     <a href="https://github.com/alexwlchan/scripts/blob/main/terraform/tfi">
       <code>tfi</code>
@@ -24,27 +24,27 @@ These scripts are all related to [Terraform], the infrastructure-as-code tool we
   <dd>
     alias for <a href="https://developer.hashicorp.com/terraform/cli/commands/init"><code>terraform init</code></a>
   </dd>
-  
+
   <dt>
     <a href="https://github.com/alexwlchan/scripts/blob/main/terraform/tfp">
       <code>tfp</code>
     </a>
   </dt>
   <dd>
-    alias for <a href="https://developer.hashicorp.com/terraform/cli/commands/plan"><code>terraform plan -out=tfplan</code></a>.
+    alias for <a href="https://developer.hashicorp.com/terraform/cli/commands/plan"><code>terraform plan -out=terraform.plan</code></a>.
     I run this before making any changes, so I can review what Terraform is about to do.
   </dd>
-  
+
   <dt>
     <a href="https://github.com/alexwlchan/scripts/blob/main/terraform/tfa">
       <code>tfa</code>
     </a>
   </dt>
   <dd>
-    alias for <a href="https://developer.hashicorp.com/terraform/cli/commands/apply"><code>terraform apply tfplan</code></a>.
+    alias for <a href="https://developer.hashicorp.com/terraform/cli/commands/apply"><code>terraform apply terraform.plan</code></a>.
     I only run this after I’ve reviewed the proposed changes from <code>tfp</code>.
   </dd>
-  
+
   <dt>
     <a href="https://github.com/alexwlchan/scripts/blob/main/terraform/tfmv">
       <code>tfmv</code>
@@ -53,7 +53,7 @@ These scripts are all related to [Terraform], the infrastructure-as-code tool we
   <dd>
     alias for <a href="https://developer.hashicorp.com/terraform/cli/commands/state/mv"><code>terraform state mv</code></a>
   </dd>
-  
+
   <dt>
     <a href="https://github.com/alexwlchan/scripts/blob/main/terraform/tflint">
       <code>tflint</code>

terraform/tfa (911) → terraform/tfa (919)

diff --git a/terraform/tfa b/terraform/tfa
index 739d8eb..f8a81ed 100755
--- a/terraform/tfa
+++ b/terraform/tfa
@@ -30,5 +30,5 @@ then
 
 # All other Terraform operations
 else
-  tf apply tfplan "$@"
+  tf apply terraform.plan "$@"
 fi

terraform/tfp (87) → terraform/tfp (654)

diff --git a/terraform/tfp b/terraform/tfp
index 6c39ba1..1ffe8e8 100755
--- a/terraform/tfp
+++ b/terraform/tfp
@@ -1,4 +1,17 @@
 #!/usr/bin/env bash
-# This is an alias for "terraform plan".
+# This is an alias for "terraform plan -out=terraform.plan".
+#
+# Note: if you read the Terraform documentation [1], it says:
+#
+#     Terraform will allow any filename for the plan file, but
+#     a typical convention is to name it tfplan.
+#
+# My use of 'terraform.plan' predates me reading about this convention,
+# and it's spread around things like .gitignore files now, so I'm sticking
+# with it for consistency rather than switching.
+#
+# The .plan suffix isn't something I use anywhere else, so I think it's fine.
+#
+# [1]: https://developer.hashicorp.com/terraform/cli/commands/plan#other-options
 
-tf plan -out=tfplan "$@"
+tf plan -out=terraform.plan "$@"