Skip to content

Instantly share code, notes, and snippets.

@dholdaway
Created August 30, 2018 20:50
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 dholdaway/dc0b8efa10d2fc489207dad7b3751c1d to your computer and use it in GitHub Desktop.
Save dholdaway/dc0b8efa10d2fc489207dad7b3751c1d to your computer and use it in GitHub Desktop.
add my ip address to AWS security group
provider "aws" {
region = "eu-west-1"
}
data "http" "ip" {
url = "http://icanhazip.com"
}
resource "aws_security_group" "ssh" {
name = "ssh"
ingress {
from_port = 22
to_port = 22
protocol = "-1"
cidr_blocks = [
"${chomp(data.http.ip.body)}/32"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment