Created
June 4, 2015 21:01
-
-
Save bakins/18ea6d23f72ecda03d96 to your computer and use it in GitHub Desktop.
terraform jq example
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
cat terraform.tfstate | jq -r '.modules[0].resources | map(select(.type == "google_compute_instance")) | map([.primary.id, " ansible_ssh_host=", .primary.attributes["network_interface.0.access_config.0.nat_ip"]] | join("")) | sort | .[]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment