Created
August 30, 2018 20:50
-
-
Save dholdaway/dc0b8efa10d2fc489207dad7b3751c1d to your computer and use it in GitHub Desktop.
add my ip address to AWS security group
This file contains hidden or 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
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