You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module"google_compute_router_nat" {
source="./modules/google-beta/r/google_compute_router_nat"# drain_nat_ips - (optional) is a type of set of stringdrain_nat_ips=[]
# enable_endpoint_independent_mapping - (optional) is a type of boolenable_endpoint_independent_mapping=null# icmp_idle_timeout_sec - (optional) is a type of numbericmp_idle_timeout_sec=null# min_ports_per_vm - (optional) is a type of numbermin_ports_per_vm=null# name - (required) is a type of stringname=null# nat_ip_allocate_option - (required) is a type of stringnat_ip_allocate_option=null# nat_ips - (optional) is a type of set of stringnat_ips=[]
# project - (optional) is a type of stringproject=null# region - (optional) is a type of stringregion=null# router - (required) is a type of stringrouter=null# source_subnetwork_ip_ranges_to_nat - (required) is a type of stringsource_subnetwork_ip_ranges_to_nat=null# tcp_established_idle_timeout_sec - (optional) is a type of numbertcp_established_idle_timeout_sec=null# tcp_transitory_idle_timeout_sec - (optional) is a type of numbertcp_transitory_idle_timeout_sec=null# udp_idle_timeout_sec - (optional) is a type of numberudp_idle_timeout_sec=nulllog_config=[{
enable =null
filter =null
}]
subnetwork=[{
name =null
secondary_ip_range_names = []
source_ip_ranges_to_nat = []
}]
timeouts=[{
create =null
delete =null
update =null
}]
}
variable"drain_nat_ips" {
description="(optional) - A list of URLs of the IP resources to be drained. These IPs must be\nvalid static external IPs that have been assigned to the NAT."type=set(string)
default=null
}
variable"enable_endpoint_independent_mapping" {
description="(optional) - Specifies if endpoint independent mapping is enabled. This is enabled by default. For more information\nsee the [official documentation](https://cloud.google.com/nat/docs/overview#specs-rfcs)."type=booldefault=null
}
variable"icmp_idle_timeout_sec" {
description="(optional) - Timeout (in seconds) for ICMP connections. Defaults to 30s if not set."type=numberdefault=null
}
variable"min_ports_per_vm" {
description="(optional) - Minimum number of ports allocated to a VM from this NAT."type=numberdefault=null
}
variable"name" {
description="(required) - Name of the NAT service. The name must be 1-63 characters long and\ncomply with RFC1035."type=string
}
variable"nat_ip_allocate_option" {
description="(required) - How external IPs should be allocated for this NAT. Valid values are\n'AUTO_ONLY' for only allowing NAT IPs allocated by Google Cloud\nPlatform, or 'MANUAL_ONLY' for only user-allocated NAT IP addresses. Possible values: [\"MANUAL_ONLY\", \"AUTO_ONLY\"]"type=string
}
variable"nat_ips" {
description="(optional) - Self-links of NAT IPs. Only valid if natIpAllocateOption\nis set to MANUAL_ONLY."type=set(string)
default=null
}
variable"project" {
description="(optional)"type=stringdefault=null
}
variable"region" {
description="(optional) - Region where the router and NAT reside."type=stringdefault=null
}
variable"router" {
description="(required) - The name of the Cloud Router in which this NAT will be configured."type=string
}
variable"source_subnetwork_ip_ranges_to_nat" {
description="(required) - How NAT should be configured per Subnetwork.\nIf 'ALL_SUBNETWORKS_ALL_IP_RANGES', all of the\nIP ranges in every Subnetwork are allowed to Nat.\nIf 'ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES', all of the primary IP\nranges in every Subnetwork are allowed to Nat.\n'LIST_OF_SUBNETWORKS': A list of Subnetworks are allowed to Nat\n(specified in the field subnetwork below). Note that if this field\ncontains ALL_SUBNETWORKS_ALL_IP_RANGES or\nALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any\nother RouterNat section in any Router for this network in this region. Possible values: [\"ALL_SUBNETWORKS_ALL_IP_RANGES\", \"ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES\", \"LIST_OF_SUBNETWORKS\"]"type=string
}
variable"tcp_established_idle_timeout_sec" {
description="(optional) - Timeout (in seconds) for TCP established connections.\nDefaults to 1200s if not set."type=numberdefault=null
}
variable"tcp_transitory_idle_timeout_sec" {
description="(optional) - Timeout (in seconds) for TCP transitory connections.\nDefaults to 30s if not set."type=numberdefault=null
}
variable"udp_idle_timeout_sec" {
description="(optional) - Timeout (in seconds) for UDP connections. Defaults to 30s if not set."type=numberdefault=null
}
variable"log_config" {
description="nested block: NestingList, min items: 0, max items: 1"type=set(object(
{
enable =bool
filter =string
}
))
default=[]
}
variable"subnetwork" {
description="nested block: NestingSet, min items: 0, max items: 0"type=set(object(
{
name =string
secondary_ip_range_names =set(string)
source_ip_ranges_to_nat =set(string)
}
))
default=[]
}
variable"timeouts" {
description="nested block: NestingSingle, min items: 0, max items: 0"type=set(object(
{
create =string
delete =string
update =string
}
))
default=[]
}
resource"google_compute_router_nat""this" {
# drain_nat_ips - (optional) is a type of set of stringdrain_nat_ips=var.drain_nat_ips# enable_endpoint_independent_mapping - (optional) is a type of boolenable_endpoint_independent_mapping=var.enable_endpoint_independent_mapping# icmp_idle_timeout_sec - (optional) is a type of numbericmp_idle_timeout_sec=var.icmp_idle_timeout_sec# min_ports_per_vm - (optional) is a type of numbermin_ports_per_vm=var.min_ports_per_vm# name - (required) is a type of stringname=var.name# nat_ip_allocate_option - (required) is a type of stringnat_ip_allocate_option=var.nat_ip_allocate_option# nat_ips - (optional) is a type of set of stringnat_ips=var.nat_ips# project - (optional) is a type of stringproject=var.project# region - (optional) is a type of stringregion=var.region# router - (required) is a type of stringrouter=var.router# source_subnetwork_ip_ranges_to_nat - (required) is a type of stringsource_subnetwork_ip_ranges_to_nat=var.source_subnetwork_ip_ranges_to_nat# tcp_established_idle_timeout_sec - (optional) is a type of numbertcp_established_idle_timeout_sec=var.tcp_established_idle_timeout_sec# tcp_transitory_idle_timeout_sec - (optional) is a type of numbertcp_transitory_idle_timeout_sec=var.tcp_transitory_idle_timeout_sec# udp_idle_timeout_sec - (optional) is a type of numberudp_idle_timeout_sec=var.udp_idle_timeout_secdynamic"log_config" {
for_each=var.log_configcontent {
# enable - (required) is a type of boolenable=log_config.value["enable"]
# filter - (required) is a type of stringfilter=log_config.value["filter"]
}
}
dynamic"subnetwork" {
for_each=var.subnetworkcontent {
# name - (required) is a type of stringname=subnetwork.value["name"]
# secondary_ip_range_names - (optional) is a type of set of stringsecondary_ip_range_names=subnetwork.value["secondary_ip_range_names"]
# source_ip_ranges_to_nat - (required) is a type of set of stringsource_ip_ranges_to_nat=subnetwork.value["source_ip_ranges_to_nat"]
}
}
dynamic"timeouts" {
for_each=var.timeoutscontent {
# create - (optional) is a type of stringcreate=timeouts.value["create"]
# delete - (optional) is a type of stringdelete=timeouts.value["delete"]
# update - (optional) is a type of stringupdate=timeouts.value["update"]
}
}
}