Skip to content

mws_vpc_firewall_rule (Resource)

Правило файрвола — набор параметров, который определяет разрешенный и запрещенный трафик

Пример использования

terraform
resource "mws_vpc_network" "network" {
  network         = var.network_name
  mtu             = 1500
  internet_access = true
}

resource "mws_vpc_firewall_rule" "firewall_rule" {
  metadata = {
    display_name = "Allow SSH"
  }

  firewall_rule = var.firewall_rule_name
  network       = mws_vpc_network.network.network

  priority  = 1000
  direction = "INGRESS"
  action    = "ALLOW"
  source = {
    spec = {
      cidrs = ["0.0.0.0/0"]
    }
  }
  destination = {
    spec = {
      cidrs = ["192.168.0.4/32"]
    }
  }
  proto_ports = ["TCP:22"]
  active      = true
}

variable "network_name" {
  type        = string
  default     = "my-test-network"
  description = "Network name"
}

variable "firewall_rule_name" {
  type        = string
  default     = "my-test-network-allow-ssh-firewall-rule"
  description = "Firewall rule name"
}

Schema

Required

  • action (String) Действие, которое должно быть применено к трафику при срабатывании правила.
  • destination (Attributes) Критерий применимости правила, описывает пункт назначения пакета. (see below for nested schema)
  • direction (String) Направление трафика, к которому применяется правило.
  • firewall_rule (String) Имя правила файрвола
  • network (String) Имя сети
  • source (Attributes) Критерий применимости правила, описывает источник отправления пакета. (see below for nested schema)

Optional

  • active (Boolean) Состояние правила. True - правило активно и контролирует поведение трафика. False - правило не активно.
  • kind (String)
  • metadata (Attributes) Метаданные правила Firewall'а. (see below for nested schema)
  • priority (Number) Приоритет правила. Чем меньше число, тем больший приоритет имеет правило.
  • project (String) Путь к проекту
  • proto_ports (List of String) Критерий применимости правила. Определяет список протоколов и соответствующих портов (если применимо) назначения пакета. Значение по умолчанию - пустое значение. Означает любой протокол и порт.
  • timeouts (Attributes) (see below for nested schema)

Read-Only

  • id (String) The ID of this resource.
  • status (Attributes) Статус правила Firewall'а. (see below for nested schema)

Nested Schema for destination

Optional:

Nested Schema for destination.spec

Required:

  • cidrs (List of String) Диапазоны IPv4 адресов, которые входят в группу.

Nested Schema for source

Optional:

Nested Schema for source.spec

Required:

  • cidrs (List of String) Диапазоны IPv4 адресов, которые входят в группу.

Nested Schema for metadata

Optional:

  • description (String) Описание ресурса
  • display_name (String) Отображаемое имя свойства
  • name (String, Deprecated) Обязательное уникальное, глобально или в пределах проекта, имя. Используется в качестве части составного идентификатора объекта.

Read-Only:

  • create_time (String) Дата создания объекта
  • delete_time (String) Время запроса на удаление ресурса
  • id (String) ID свойства
  • purge_time (String) Время удаления ресурса
  • usages (Attributes List) Связи с другими ресурсами. В зависимости от типа связи, операции над ресурсом могут быть ограничены (see below for nested schema)

Nested Schema for metadata.usages

Read-Only:

  • name (String) Имя связи, требуется для модификации коллекции
  • resource (String) Ссылка на ресурс
  • usage_type (String) Тип связи. Помимо стандартных own и use могут быть добавлены специализированные типы для конкретных сервисов

Nested Schema for timeouts

Optional:

  • create (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
  • delete (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
  • update (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

Nested Schema for status

Read-Only:

  • active (Boolean) Состояние правила. True - правило активно и контролирует поведение трафика. False - правило не активно.
  • priority (Number) Эффективный приоритет правила.
  • ready (Attributes) Информация о статусе реконсиляции (see below for nested schema)

Nested Schema for status.ready

Read-Only:

  • message (String) Описание статуса
  • state (String) Состояние ресурса