Skip to content

Instantly share code, notes, and snippets.

@jayers99
Last active February 22, 2019 18:02
Show Gist options
  • Save jayers99/f456890c17a318cf390cc7711056d2bf to your computer and use it in GitHub Desktop.
Save jayers99/f456890c17a318cf390cc7711056d2bf to your computer and use it in GitHub Desktop.
jq terraform state fun
cat statefile.tfstate | jq '.. | objects | with_entries(select(.key | contains("aws_network_acl_rule"))) | select(. != {})'
# all the acl objects
jq '.modules[].resources[].primary | select(.id | startswith("acl-"))' statefile.tfstate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment