What Terraform feature is shown in the example below?
1. resource "aws_security_group" "example" {
2. name = "sg-app-web-01"
3. dynamic "ingress" {
4. for_each = var.service_ports
5. content {
6. from_port = ingress.value
7. to_port = ingress.value
8. protocol = "tcp"
9. }
10. }
11. }
You can dynamically construct repeatable nested blocks like ingress using a special dynamic block type, which is supported inside resource, data, provider, and provisioner blocks
Currently there are no comments in this discussion, be the first to comment!