Created
February 17, 2020 16:13
-
-
Save mbklein/bce0732fe8562c40c4de7156a8205dc0 to your computer and use it in GitHub Desktop.
Get Terraform resource IDs from state file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq -r '[.modules[] | (.path|join(".")) as $path | .resources | to_entries[] | { "key": ($path + "." + .key), "value": .value.primary.id }] | from_entries' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment