Created
May 9, 2018 22:24
-
-
Save quanghiem/5cbba4cb4028b864703d62b44e183def to your computer and use it in GitHub Desktop.
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
data "aws_instance" "xxx" { | |
filter { | |
name = "tag:Name" | |
values = ["xxx"] | |
} | |
} | |
resource "aws_security_group" "xxx" { | |
name = "xxx" | |
vpc_id = "${var.vpc_id}" | |
} | |
resource "aws_security_group_rule" "add_ons" { | |
type = "ingress" | |
from_port = "80" | |
to_port = "80" | |
protocol = "tcp" | |
cidr_blocks = [ | |
"${data.aws_instance.public_ip}/32" | |
] | |
security_group_id = "${aws.aws_security_group.id}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment