Skip to content
Odinex Cloud
Terraform providerReferenceResources

odinex_nat_gateway

Manages the NAT gateway of a private network (one per network). Servers without public IPs in the network reach the internet from the gateway's public IPv4; the gateway takes the first host of the network (its gateway).

Manages the NAT gateway of a private network (one per network). Servers without public IPs in the network reach the internet from the gateway's public IPv4; the gateway takes the first host of the network (its gateway).

Example Usage

resource "odinex_nat_gateway" "private" {
  name       = "private"
  network_id = odinex_network.private.id
}

Schema

Required

  • network_id (Number) ID of the network. Changing it creates a new NAT gateway.

Optional

  • labels (Map of String) User-defined labels (key/value pairs). Up to 64 pairs; keys and values up to 63 characters.
  • name (String) Name of the NAT gateway.
  • timeouts (Block, Optional)

Read-Only

  • id (String) Unique ID of the resource.
  • location (String) Location of the NAT gateway (the network's location).
  • private_ip (String) Address of the gateway inside the network (the default gateway of its servers).
  • public_ip (String) Public IPv4 address the network's traffic leaves from.
  • status (String) Status of the NAT gateway (creating, available, deleting).

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.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

terraform import odinex_nat_gateway.private 6

On this page