RouterNat
A NAT service created in a router.
To get more information about RouterNat, see:
- API documentation
- How-to Guides
Create a RouterNat Resource
new RouterNat(name: string, args: RouterNatArgs, opts?: CustomResourceOptions);def RouterNat(resource_name, opts=None, drain_nat_ips=None, icmp_idle_timeout_sec=None, log_config=None, min_ports_per_vm=None, name=None, nat_ip_allocate_option=None, nat_ips=None, project=None, region=None, router=None, source_subnetwork_ip_ranges_to_nat=None, subnetworks=None, tcp_established_idle_timeout_sec=None, tcp_transitory_idle_timeout_sec=None, udp_idle_timeout_sec=None, __props__=None);func NewRouterNat(ctx *Context, name string, args RouterNatArgs, opts ...ResourceOption) (*RouterNat, error)public RouterNat(string name, RouterNatArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args RouterNatArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RouterNatArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouterNatArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
RouterNat Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The RouterNat resource accepts the following input properties:
- Nat
Ip stringAllocate Option How external IPs should be allocated for this NAT. Valid values are
AUTO_ONLYfor only allowing NAT IPs allocated by Google Cloud Platform, orMANUAL_ONLYfor only user-allocated NAT IP addresses.- Router string
The name of the Cloud Router in which this NAT will be configured.
- Source
Subnetwork stringIp Ranges To Nat How NAT should be configured per Subnetwork. If
ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. IfALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat.LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region.- Drain
Nat List<string>Ips A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
- Icmp
Idle intTimeout Sec Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
- Log
Config RouterNat Log Config Args Configuration for logging on NAT Structure is documented below.
- Min
Ports intPer Vm Minimum number of ports allocated to a VM from this NAT.
- Name string
Self-link of subnetwork to NAT
- Nat
Ips List<string> Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
Region where the router and NAT reside.
- Subnetworks
List<Router
Nat Subnetwork Args> One or more subnetwork NAT configurations. Only used if
source_subnetwork_ip_ranges_to_natis set toLIST_OF_SUBNETWORKSStructure is documented below.- Tcp
Established intIdle Timeout Sec Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
- Tcp
Transitory intIdle Timeout Sec Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
- Udp
Idle intTimeout Sec Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
- Nat
Ip stringAllocate Option How external IPs should be allocated for this NAT. Valid values are
AUTO_ONLYfor only allowing NAT IPs allocated by Google Cloud Platform, orMANUAL_ONLYfor only user-allocated NAT IP addresses.- Router string
The name of the Cloud Router in which this NAT will be configured.
- Source
Subnetwork stringIp Ranges To Nat How NAT should be configured per Subnetwork. If
ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. IfALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat.LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region.- Drain
Nat []stringIps A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
- Icmp
Idle intTimeout Sec Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
- Log
Config RouterNat Log Config Configuration for logging on NAT Structure is documented below.
- Min
Ports intPer Vm Minimum number of ports allocated to a VM from this NAT.
- Name string
Self-link of subnetwork to NAT
- Nat
Ips []string Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
Region where the router and NAT reside.
- Subnetworks
[]Router
Nat Subnetwork One or more subnetwork NAT configurations. Only used if
source_subnetwork_ip_ranges_to_natis set toLIST_OF_SUBNETWORKSStructure is documented below.- Tcp
Established intIdle Timeout Sec Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
- Tcp
Transitory intIdle Timeout Sec Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
- Udp
Idle intTimeout Sec Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
- nat
Ip stringAllocate Option How external IPs should be allocated for this NAT. Valid values are
AUTO_ONLYfor only allowing NAT IPs allocated by Google Cloud Platform, orMANUAL_ONLYfor only user-allocated NAT IP addresses.- router string
The name of the Cloud Router in which this NAT will be configured.
- source
Subnetwork stringIp Ranges To Nat How NAT should be configured per Subnetwork. If
ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. IfALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat.LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region.- drain
Nat string[]Ips A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
- icmp
Idle numberTimeout Sec Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
- log
Config RouterNat Log Config Configuration for logging on NAT Structure is documented below.
- min
Ports numberPer Vm Minimum number of ports allocated to a VM from this NAT.
- name string
Self-link of subnetwork to NAT
- nat
Ips string[] Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
Region where the router and NAT reside.
- subnetworks
Router
Nat Subnetwork[] One or more subnetwork NAT configurations. Only used if
source_subnetwork_ip_ranges_to_natis set toLIST_OF_SUBNETWORKSStructure is documented below.- tcp
Established numberIdle Timeout Sec Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
- tcp
Transitory numberIdle Timeout Sec Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
- udp
Idle numberTimeout Sec Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
- nat_
ip_ strallocate_ option How external IPs should be allocated for this NAT. Valid values are
AUTO_ONLYfor only allowing NAT IPs allocated by Google Cloud Platform, orMANUAL_ONLYfor only user-allocated NAT IP addresses.- router str
The name of the Cloud Router in which this NAT will be configured.
- source_
subnetwork_ strip_ ranges_ to_ nat How NAT should be configured per Subnetwork. If
ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. IfALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat.LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region.- drain_
nat_ List[str]ips A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
- icmp_
idle_ floattimeout_ sec Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
- log_
config Dict[RouterNat Log Config] Configuration for logging on NAT Structure is documented below.
- min_
ports_ floatper_ vm Minimum number of ports allocated to a VM from this NAT.
- name str
Self-link of subnetwork to NAT
- nat_
ips List[str] Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region str
Region where the router and NAT reside.
- subnetworks
List[Router
Nat Subnetwork] One or more subnetwork NAT configurations. Only used if
source_subnetwork_ip_ranges_to_natis set toLIST_OF_SUBNETWORKSStructure is documented below.- tcp_
established_ floatidle_ timeout_ sec Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
- tcp_
transitory_ floatidle_ timeout_ sec Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
- udp_
idle_ floattimeout_ sec Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
Outputs
All input properties are implicitly available as output properties. Additionally, the RouterNat resource produces the following output properties:
Look up an Existing RouterNat Resource
Get an existing RouterNat resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RouterNatState, opts?: CustomResourceOptions): RouterNatstatic get(resource_name, id, opts=None, drain_nat_ips=None, icmp_idle_timeout_sec=None, log_config=None, min_ports_per_vm=None, name=None, nat_ip_allocate_option=None, nat_ips=None, project=None, region=None, router=None, source_subnetwork_ip_ranges_to_nat=None, subnetworks=None, tcp_established_idle_timeout_sec=None, tcp_transitory_idle_timeout_sec=None, udp_idle_timeout_sec=None, __props__=None);func GetRouterNat(ctx *Context, name string, id IDInput, state *RouterNatState, opts ...ResourceOption) (*RouterNat, error)public static RouterNat Get(string name, Input<string> id, RouterNatState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Drain
Nat List<string>Ips A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
- Icmp
Idle intTimeout Sec Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
- Log
Config RouterNat Log Config Args Configuration for logging on NAT Structure is documented below.
- Min
Ports intPer Vm Minimum number of ports allocated to a VM from this NAT.
- Name string
Self-link of subnetwork to NAT
- Nat
Ip stringAllocate Option How external IPs should be allocated for this NAT. Valid values are
AUTO_ONLYfor only allowing NAT IPs allocated by Google Cloud Platform, orMANUAL_ONLYfor only user-allocated NAT IP addresses.- Nat
Ips List<string> Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
Region where the router and NAT reside.
- Router string
The name of the Cloud Router in which this NAT will be configured.
- Source
Subnetwork stringIp Ranges To Nat How NAT should be configured per Subnetwork. If
ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. IfALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat.LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region.- Subnetworks
List<Router
Nat Subnetwork Args> One or more subnetwork NAT configurations. Only used if
source_subnetwork_ip_ranges_to_natis set toLIST_OF_SUBNETWORKSStructure is documented below.- Tcp
Established intIdle Timeout Sec Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
- Tcp
Transitory intIdle Timeout Sec Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
- Udp
Idle intTimeout Sec Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
- Drain
Nat []stringIps A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
- Icmp
Idle intTimeout Sec Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
- Log
Config RouterNat Log Config Configuration for logging on NAT Structure is documented below.
- Min
Ports intPer Vm Minimum number of ports allocated to a VM from this NAT.
- Name string
Self-link of subnetwork to NAT
- Nat
Ip stringAllocate Option How external IPs should be allocated for this NAT. Valid values are
AUTO_ONLYfor only allowing NAT IPs allocated by Google Cloud Platform, orMANUAL_ONLYfor only user-allocated NAT IP addresses.- Nat
Ips []string Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
Region where the router and NAT reside.
- Router string
The name of the Cloud Router in which this NAT will be configured.
- Source
Subnetwork stringIp Ranges To Nat How NAT should be configured per Subnetwork. If
ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. IfALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat.LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region.- Subnetworks
[]Router
Nat Subnetwork One or more subnetwork NAT configurations. Only used if
source_subnetwork_ip_ranges_to_natis set toLIST_OF_SUBNETWORKSStructure is documented below.- Tcp
Established intIdle Timeout Sec Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
- Tcp
Transitory intIdle Timeout Sec Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
- Udp
Idle intTimeout Sec Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
- drain
Nat string[]Ips A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
- icmp
Idle numberTimeout Sec Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
- log
Config RouterNat Log Config Configuration for logging on NAT Structure is documented below.
- min
Ports numberPer Vm Minimum number of ports allocated to a VM from this NAT.
- name string
Self-link of subnetwork to NAT
- nat
Ip stringAllocate Option How external IPs should be allocated for this NAT. Valid values are
AUTO_ONLYfor only allowing NAT IPs allocated by Google Cloud Platform, orMANUAL_ONLYfor only user-allocated NAT IP addresses.- nat
Ips string[] Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
Region where the router and NAT reside.
- router string
The name of the Cloud Router in which this NAT will be configured.
- source
Subnetwork stringIp Ranges To Nat How NAT should be configured per Subnetwork. If
ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. IfALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat.LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region.- subnetworks
Router
Nat Subnetwork[] One or more subnetwork NAT configurations. Only used if
source_subnetwork_ip_ranges_to_natis set toLIST_OF_SUBNETWORKSStructure is documented below.- tcp
Established numberIdle Timeout Sec Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
- tcp
Transitory numberIdle Timeout Sec Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
- udp
Idle numberTimeout Sec Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
- drain_
nat_ List[str]ips A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT.
- icmp_
idle_ floattimeout_ sec Timeout (in seconds) for ICMP connections. Defaults to 30s if not set.
- log_
config Dict[RouterNat Log Config] Configuration for logging on NAT Structure is documented below.
- min_
ports_ floatper_ vm Minimum number of ports allocated to a VM from this NAT.
- name str
Self-link of subnetwork to NAT
- nat_
ip_ strallocate_ option How external IPs should be allocated for this NAT. Valid values are
AUTO_ONLYfor only allowing NAT IPs allocated by Google Cloud Platform, orMANUAL_ONLYfor only user-allocated NAT IP addresses.- nat_
ips List[str] Self-links of NAT IPs. Only valid if natIpAllocateOption is set to MANUAL_ONLY.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region str
Region where the router and NAT reside.
- router str
The name of the Cloud Router in which this NAT will be configured.
- source_
subnetwork_ strip_ ranges_ to_ nat How NAT should be configured per Subnetwork. If
ALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. IfALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat.LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region.- subnetworks
List[Router
Nat Subnetwork] One or more subnetwork NAT configurations. Only used if
source_subnetwork_ip_ranges_to_natis set toLIST_OF_SUBNETWORKSStructure is documented below.- tcp_
established_ floatidle_ timeout_ sec Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set.
- tcp_
transitory_ floatidle_ timeout_ sec Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set.
- udp_
idle_ floattimeout_ sec Timeout (in seconds) for UDP connections. Defaults to 30s if not set.
Supporting Types
RouterNatLogConfig
RouterNatSubnetwork
- Name string
Self-link of subnetwork to NAT
- Source
Ip List<string>Ranges To Nats List of options for which source IPs in the subnetwork should have NAT enabled. Supported values include:
ALL_IP_RANGES,LIST_OF_SECONDARY_IP_RANGES,PRIMARY_IP_RANGE.- Secondary
Ip List<string>Range Names List of the secondary ranges of the subnetwork that are allowed to use NAT. This can be populated only if
LIST_OF_SECONDARY_IP_RANGESis one of the values in sourceIpRangesToNat
- Name string
Self-link of subnetwork to NAT
- Source
Ip []stringRanges To Nats List of options for which source IPs in the subnetwork should have NAT enabled. Supported values include:
ALL_IP_RANGES,LIST_OF_SECONDARY_IP_RANGES,PRIMARY_IP_RANGE.- Secondary
Ip []stringRange Names List of the secondary ranges of the subnetwork that are allowed to use NAT. This can be populated only if
LIST_OF_SECONDARY_IP_RANGESis one of the values in sourceIpRangesToNat
- name string
Self-link of subnetwork to NAT
- source
Ip string[]Ranges To Nats List of options for which source IPs in the subnetwork should have NAT enabled. Supported values include:
ALL_IP_RANGES,LIST_OF_SECONDARY_IP_RANGES,PRIMARY_IP_RANGE.- secondary
Ip string[]Range Names List of the secondary ranges of the subnetwork that are allowed to use NAT. This can be populated only if
LIST_OF_SECONDARY_IP_RANGESis one of the values in sourceIpRangesToNat
- name str
Self-link of subnetwork to NAT
- source
Ip List[str]Ranges To Nats List of options for which source IPs in the subnetwork should have NAT enabled. Supported values include:
ALL_IP_RANGES,LIST_OF_SECONDARY_IP_RANGES,PRIMARY_IP_RANGE.- secondary
Ip List[str]Range Names List of the secondary ranges of the subnetwork that are allowed to use NAT. This can be populated only if
LIST_OF_SECONDARY_IP_RANGESis one of the values in sourceIpRangesToNat
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.