# Cloud NAT Module
Simple Cloud NAT management, with optional router creation.
## Example
```hcl
module "nat" {
source = "./modules/net-cloudnat"
project_id = "my-project"
region = "europe-west1"
name = "default"
router_network = "my-vpc"
}
# tftest modules=1 resources=2
```
## Variables
| name | description | type | required | default |
|---|---|:---:|:---:|:---:|
| [name](variables.tf#L57) | Name of the Cloud NAT resource. | string
| ✓ | |
| [project_id](variables.tf#L62) | Project where resources will be created. | string
| ✓ | |
| [region](variables.tf#L67) | Region where resources will be created. | string
| ✓ | |
| [addresses](variables.tf#L17) | Optional list of external address self links. | list(string)
| | []
|
| [config_min_ports_per_vm](variables.tf#L23) | Minimum number of ports allocated to a VM from this NAT config. | number
| | 64
|
| [config_source_subnets](variables.tf#L29) | Subnetwork configuration (ALL_SUBNETWORKS_ALL_IP_RANGES, ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, LIST_OF_SUBNETWORKS). | string
| | "ALL_SUBNETWORKS_ALL_IP_RANGES"
|
| [config_timeouts](variables.tf#L35) | Timeout configurations. | object({…})
| | {…}
|
| [logging_filter](variables.tf#L51) | Enables logging if not null, value is one of 'ERRORS_ONLY', 'TRANSLATIONS_ONLY', 'ALL'. | string
| | null
|
| [router_asn](variables.tf#L72) | Router ASN used for auto-created router. | number
| | 64514
|
| [router_create](variables.tf#L78) | Create router. | bool
| | true
|
| [router_name](variables.tf#L84) | Router name, leave blank if router will be created to use auto generated name. | string
| | null
|
| [router_network](variables.tf#L90) | Name of the VPC used for auto-created router. | string
| | null
|
| [subnetworks](variables.tf#L96) | Subnetworks to NAT, only used when config_source_subnets equals LIST_OF_SUBNETWORKS. | list(object({…}))
| | []
|
## Outputs
| name | description | sensitive |
|---|---|:---:|
| [name](outputs.tf#L17) | Name of the Cloud NAT. | |
| [nat_ip_allocate_option](outputs.tf#L22) | NAT IP allocation mode. | |
| [region](outputs.tf#L27) | Cloud NAT region. | |
| [router](outputs.tf#L32) | Cloud NAT router resources (if auto created). | |
| [router_name](outputs.tf#L41) | Cloud NAT router name. | |