Skip to content

Instantly share code, notes, and snippets.

@thegedge
Created September 30, 2015 15:44
Show Gist options
  • Save thegedge/bf6054f9c8f43bc38f4a to your computer and use it in GitHub Desktop.
Save thegedge/bf6054f9c8f43bc38f4a to your computer and use it in GitHub Desktop.
Security group rule for multiple SGs
resource "aws_security_group_rule" "allow_all" {
count = "${length(split(",", var.security_group_ids))}"
type = "ingress"
from_port = 0
to_port = 65535
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = "${element(split(",", var.security_group_ids), count.index)}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment