Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jjruescas/e5e578076c93cc6f21e190d19ae79afc to your computer and use it in GitHub Desktop.
Save jjruescas/e5e578076c93cc6f21e190d19ae79afc to your computer and use it in GitHub Desktop.
data "http" "myip" {
url = "http://ipv4.icanhazip.com"
}
resource "aws_security_group_rule" "ingress_with_cidr_blocks" {
...
ingress {
from_port = 5432
to_port = 5432
protocol = "tcp"
cidr_blocks = ["${chomp(data.http.myip.body)}/32"]
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment