# ionoscloud\_natgateway

Manages a [Nat Gateway](https://docs.ionos.com/cloud/network-services/nat-gateway/overview) on IONOS CLOUD.

## Example Usage

```hcl
resource "ionoscloud_datacenter" "example" {
    name                    = "Datacenter Example"
    location                = "us/las"
    description             = "Datacenter Description"
    sec_auth_protection     = false
}

resource "ionoscloud_ipblock" "example" {
    location                = "us/las"
    size                    = 2
    name                    = "IP Block Example"
}

resource "ionoscloud_lan" "example" {
    datacenter_id           = ionoscloud_datacenter.example.id
    public                  = false
    name                    = "Lan Example"
}

resource "ionoscloud_natgateway" "example" {
    datacenter_id           = ionoscloud_datacenter.example.id
    name                    = "example"
    public_ips              = [ ionoscloud_ipblock.example.ips[0], ionoscloud_ipblock.example.ips[1] ]
     lans {
        id                  = ionoscloud_lan.example.id
        gateway_ips         = [ "10.11.2.5"]
     }
}
```

## Argument reference

* `name` - (Required)\[string] Name of the NAT gateway.
* `public_ips` - (Required)\[list]Collection of public IP addresses of the NAT gateway. Should be customer reserved IP addresses in that location.
* `lans` - (Required)\[list] A list of Local Area Networks the node pool should be part of.
  * `id` - (Required)\[int] Id for the LAN connected to the NAT gateway.
  * `gateway_ips` - (Optional)\[list] Collection of gateway IP addresses of the NAT gateway. Will be auto-generated if not provided. Should ideally be an IP belonging to the same subnet as the LAN.
* `datacenter_id` - (Required)\[string] A Datacenter's UUID.

## Import

A Nat Gateway resource can be imported using its `resource id` and the `datacenter id`, e.g.

```shell
terraform import ionoscloud_natgateway.my_natgateway datacenter uuid/nat gateway uuid
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/terraform-provider/resources/natgateway.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
