Files
terraform-course/foreach-demo/securitygroup.tf
T
2019-10-30 16:05:22 +01:00

13 lines
256 B
Terraform

resource "aws_security_group" "example" {
name = "example" # can use expressions here
dynamic "ingress" {
for_each = [22, 443]
content {
from_port = ingress.value
to_port = ingress.value
protocol = "tcp"
}
}
}