add a tflint alias
- ID
dd26743- date
2023-05-01 07:16:25+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
d2d8650- message
add a tflint alias- changed files
2 files, 22 additions, 1 deletion
Changed files
terraform/README.md (2497) → terraform/README.md (2770)
diff --git a/terraform/README.md b/terraform/README.md
index 1aa8334..7ef4d5d 100644
--- a/terraform/README.md
+++ b/terraform/README.md
@@ -1,6 +1,6 @@
# terraform
-These scripts are all aliases around [Terraform], the infrastructure-as-code tool we use at work.
+These scripts are all related to [Terraform], the infrastructure-as-code tool we use at work.
[Terraform]: https://www.terraform.io/
@@ -53,6 +53,15 @@ These scripts are all aliases around [Terraform], the infrastructure-as-code too
<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>
+ </a>
+ </dt>
+ <dd>
+ alias for the <a href="https://github.com/terraform-linters/tflint">tflint linter</a>, but running inside a Docker container
+ </dd>
</dl>
## Choosing between `terraform` and `run_terraform.sh`
terraform/tflint (0) → terraform/tflint (307)
diff --git a/terraform/tflint b/terraform/tflint
new file mode 100755
index 0000000..dabbdce
--- /dev/null
+++ b/terraform/tflint
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+# This runs the Terraform linter 'tflint'.
+#
+# It runs the linter inside a Docker image, so I don't have to worry
+# about installing it before I use it.
+
+set -o errexit
+set -o nounset
+
+docker run --rm --tty \
+ --volume $(pwd):/data \
+ ghcr.io/terraform-linters/tflint --recursive "$@"