Skip to content

Instantly share code, notes, and snippets.

View paulojmdias's full-sized avatar
🚀

Paulo Dias paulojmdias

🚀
View GitHub Profile
@paulojmdias
paulojmdias / tf_vars_sort.awk
Created December 14, 2021 12:02
Terraform sort variables with AWK
#!/usr/bin/env -S awk -f
# https://gist.github.com/yermulnik/7e0cf991962680d406692e1db1b551e6
# Tested with GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0)
# Usage: cat variables.tf | awk -f /path/to/tf_vars_sort.awk | tee sorted_variables.tf
# No licensing; yermulnik@gmail.com, 2021
{
# drop blank lines at the beginning of file
if (!resource_type && length($0) == 0) next
# pick only known and easily parsable (for our goal) TF block names

Keybase proof

I hereby claim:

  • I am paulojmdias on github.
  • I am paulodias (https://keybase.io/paulodias) on keybase.
  • I have a public key ASDg-ocaeeun9u27I06xSD_qth8nXGqvDuzCV-Vk5zCHKQo

To claim this, I am signing this object: