Skip to content

Instantly share code, notes, and snippets.

@nshenry03
Last active February 14, 2019 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nshenry03/8d34fb1eedc4a1d3a2e902df21744511 to your computer and use it in GitHub Desktop.
Save nshenry03/8d34fb1eedc4a1d3a2e902df21744511 to your computer and use it in GitHub Desktop.
Assert that all variables are used and that all variables are defined.
diff -rupN \
<(
ack '^\s*variable\s*"' variables.tf \
| awk '{print $2}' \
| sed -e 's/"//g' \
| sort -u
) \
<(
ack -o "var\.\w+" main.tf \
| sed -e 's/var\.//' \
| sort -u
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment