aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/yandex/firewall/main.tf
blob: 81dc26ac8cfc0cdcfa1a2b316ef0ee7943c56e46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
resource "yandex_vpc_security_group" "this" {
  network_id = var.vpc_id

  name = var.name

  ingress {
    protocol       = "ICMP"
    v4_cidr_blocks = ["0.0.0.0/0"]
  }

  dynamic "ingress" {
    for_each = var.open_ports

    content {
      protocol       = "ANY"
      v4_cidr_blocks = ["0.0.0.0/0"]
      port           = ingress.value
    }
  }

  egress {
    protocol       = "ANY"
    v4_cidr_blocks = ["0.0.0.0/0"]
  }
}