Skip to content

mws_vpc_one_to_one_nat (Resource)

One-to-One NAT-шлюз — механизм, с помощью которого ресурсы во внутренней сети могут выходить в интернет через внешний IP-адрес

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

terraform
resource "mws_vpc_network" "network" {
  network = var.network_name
}

resource "mws_vpc_subnet" "subnet" {
  subnet  = var.subnet_name
  network = mws_vpc_network.network.network
  cidr    = var.subnet_cidr
}

resource "mws_vpc_address" "internal_address" {
  address = var.internal_address_name
  network = mws_vpc_network.network.network
  subnet  = mws_vpc_subnet.subnet.metadata.id
}

resource "mws_vpc_external_address" "address" {
  external_address = var.external_address_name
}

resource "mws_vpc_one_to_one_nat" "example" {
  network        = mws_vpc_network.network.network
  one_to_one_nat = var.one_to_one_name

  external = {
    address = {
      ref = mws_vpc_external_address.address.metadata.id
    }
  }

  internal = {
    address = {
      ref = mws_vpc_address.internal_address.metadata.id
    }
  }
}

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

variable "subnet_name" {
  type        = string
  default     = "my-test-subnet"
  description = "Subnet name"
}

variable "subnet_cidr" {
  type        = string
  default     = "192.168.0.0/16"
  description = "Subnet CIDR"
}

variable "internal_address_name" {
  type        = string
  default     = "my-test-internal-address"
  description = "Internal address name"
}

variable "external_address_name" {
  type        = string
  default     = "my-test-external-address"
  description = "External address name"
}

variable "one_to_one_name" {
  type        = string
  default     = "my-test-one-to-one"
  description = "One-to-One NAT name"
}

Schema

Required

  • external (Attributes) Группирующий элемент для всего что, касается внешней части (ресурсов, доступных извне). (see below for nested schema)
  • internal (Attributes) Группирующий элемент для всего, что касается внутренних ресурсов. (see below for nested schema)
  • network (String) Имя сети
  • one_to_one_nat (String) Имя One-to-One NAT

Optional

  • kind (String)
  • metadata (Attributes) Набор общих для всех пользовательских объектов атрибутов. Может быть расширен атрибутами, специфичными для контейнеров. (see below for nested schema)
  • project (String) Путь к проекту
  • timeouts (Attributes) (see below for nested schema)

Read-Only

  • id (String) The ID of this resource.
  • status (Attributes) Описывает статус One-to-One NAT-шлюза. (see below for nested schema)

Nested Schema for external

Required:

  • address (Attributes) Спецификация внешнего адреса, через который будет осуществляться трансляция. (see below for nested schema)

Nested Schema for external.address

Optional:

  • ref (String) Относительная ссылка на статический внешний адрес.

Nested Schema for internal

Required:

  • address (Attributes) Спецификация внутреннего адреса, для которого будет осуществляться трансляция. (see below for nested schema)

Nested Schema for internal.address

Optional:

  • ref (String) Относительная ссылка на статический внутренний адрес.

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:

  • external (Attributes) Группирующий элемент для всего, что касается внешней части (ресурсов, доступных извне). (see below for nested schema)
  • internal (Attributes) Группирующий элемент для всего, что касается внутренних ресурсов. (see below for nested schema)
  • ready (Attributes) Информация о статусе реконсиляции (see below for nested schema)

Nested Schema for status.external

Read-Only:

  • address (Attributes) Спецификация внешнего адреса, через который будет осуществляться трансляция. (see below for nested schema)

Nested Schema for status.external.address

Read-Only:

  • ip_address (String) Значение IP адреса.
  • ref (String) Относительная ссылка на статический адрес.

Nested Schema for status.internal

Read-Only:

  • address (Attributes) Спецификация внутреннего адреса, для которого будет осуществляться трансляция. (see below for nested schema)

Nested Schema for status.internal.address

Read-Only:

  • ip_address (String) Значение IP адреса.
  • ref (String) Относительная ссылка на статический адрес.

Nested Schema for status.ready

Read-Only:

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