Skip to content

Instantly share code, notes, and snippets.

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 epcim/2d0d61442a745e9cd5afb85ef8e45aa8 to your computer and use it in GitHub Desktop.
Save epcim/2d0d61442a745e9cd5afb85ef8e45aa8 to your computer and use it in GitHub Desktop.
terraform jq example
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