aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/yandex/firewall/main.tf
blob: 81dc26ac8cfc0cdcfa1a2b316ef0ee7943c56e46 (plain) (tree)
























                                             
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"]
  }
}