Skip to content

Instantly share code, notes, and snippets.

@chrismarget
Created December 19, 2022 20:45
Show Gist options
  • Save chrismarget/768be3c2a7aa3c55566890279c7ba5f7 to your computer and use it in GitHub Desktop.
Save chrismarget/768be3c2a7aa3c55566890279c7ba5f7 to your computer and use it in GitHub Desktop.
terraform technique to get own external IP address -- useful for writing debug-friendly security group rules
data "external" "operator_ip" {
program = ["bash", "-c", "jq -n --arg ip $(curl -s https://checkip.amazonaws.com) '{\"ip\":$ip}'"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment