gcp.compute.getRouterNat
Explore with Pulumi AI
To get more information about Snapshot, see:
- API documentation
- How-to Guides
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const foo = gcp.compute.getRouterNat({
name: "my-nat",
router: "my-router",
});
import pulumi
import pulumi_gcp as gcp
foo = gcp.compute.get_router_nat(name="my-nat",
router="my-router")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.LookupRouterNat(ctx, &compute.LookupRouterNatArgs{
Name: "my-nat",
Router: "my-router",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var foo = Gcp.Compute.GetRouterNat.Invoke(new()
{
Name = "my-nat",
Router = "my-router",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetRouterNatArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var foo = ComputeFunctions.getRouterNat(GetRouterNatArgs.builder()
.name("my-nat")
.router("my-router")
.build());
}
}
variables:
foo:
fn::invoke:
Function: gcp:compute:getRouterNat
Arguments:
name: my-nat
router: my-router
Using getRouterNat
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getRouterNat(args: GetRouterNatArgs, opts?: InvokeOptions): Promise<GetRouterNatResult>
function getRouterNatOutput(args: GetRouterNatOutputArgs, opts?: InvokeOptions): Output<GetRouterNatResult>
def get_router_nat(name: Optional[str] = None,
project: Optional[str] = None,
region: Optional[str] = None,
router: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRouterNatResult
def get_router_nat_output(name: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
router: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRouterNatResult]
func LookupRouterNat(ctx *Context, args *LookupRouterNatArgs, opts ...InvokeOption) (*LookupRouterNatResult, error)
func LookupRouterNatOutput(ctx *Context, args *LookupRouterNatOutputArgs, opts ...InvokeOption) LookupRouterNatResultOutput
> Note: This function is named LookupRouterNat
in the Go SDK.
public static class GetRouterNat
{
public static Task<GetRouterNatResult> InvokeAsync(GetRouterNatArgs args, InvokeOptions? opts = null)
public static Output<GetRouterNatResult> Invoke(GetRouterNatInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRouterNatResult> getRouterNat(GetRouterNatArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:compute/getRouterNat:getRouterNat
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
- Router string
- The name of the Cloud Router in which this NAT will be configured.
- 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.
- Name string
- Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
- Router string
- The name of the Cloud Router in which this NAT will be configured.
- 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.
- name String
- Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
- router String
- The name of the Cloud Router in which this NAT will be configured.
- 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.
- name string
- Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
- router string
- The name of the Cloud Router in which this NAT will be configured.
- 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.
- name str
- Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
- router str
- The name of the Cloud Router in which this NAT will be configured.
- 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.
- name String
- Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
- router String
- The name of the Cloud Router in which this NAT will be configured.
- 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.
getRouterNat Result
The following output properties are available:
- Auto
Network stringTier - Drain
Nat List<string>Ips - Enable
Dynamic boolPort Allocation - Enable
Endpoint boolIndependent Mapping - Endpoint
Types List<string> - Icmp
Idle intTimeout Sec - Id string
- The provider-assigned unique ID for this managed resource.
- Log
Configs List<GetRouter Nat Log Config> - Max
Ports intPer Vm - Min
Ports intPer Vm - Name string
- Nat
Ip stringAllocate Option - Nat
Ips List<string> - Router string
- Rules
List<Get
Router Nat Rule> - Source
Subnetwork stringIp Ranges To Nat - Subnetworks
List<Get
Router Nat Subnetwork> - Tcp
Established intIdle Timeout Sec - Tcp
Time intWait Timeout Sec - Tcp
Transitory intIdle Timeout Sec - Type string
- Udp
Idle intTimeout Sec - Project string
- Region string
- Auto
Network stringTier - Drain
Nat []stringIps - Enable
Dynamic boolPort Allocation - Enable
Endpoint boolIndependent Mapping - Endpoint
Types []string - Icmp
Idle intTimeout Sec - Id string
- The provider-assigned unique ID for this managed resource.
- Log
Configs []GetRouter Nat Log Config - Max
Ports intPer Vm - Min
Ports intPer Vm - Name string
- Nat
Ip stringAllocate Option - Nat
Ips []string - Router string
- Rules
[]Get
Router Nat Rule - Source
Subnetwork stringIp Ranges To Nat - Subnetworks
[]Get
Router Nat Subnetwork - Tcp
Established intIdle Timeout Sec - Tcp
Time intWait Timeout Sec - Tcp
Transitory intIdle Timeout Sec - Type string
- Udp
Idle intTimeout Sec - Project string
- Region string
- auto
Network StringTier - drain
Nat List<String>Ips - enable
Dynamic BooleanPort Allocation - enable
Endpoint BooleanIndependent Mapping - endpoint
Types List<String> - icmp
Idle IntegerTimeout Sec - id String
- The provider-assigned unique ID for this managed resource.
- log
Configs List<GetRouter Nat Log Config> - max
Ports IntegerPer Vm - min
Ports IntegerPer Vm - name String
- nat
Ip StringAllocate Option - nat
Ips List<String> - router String
- rules
List<Get
Router Nat Rule> - source
Subnetwork StringIp Ranges To Nat - subnetworks
List<Get
Router Nat Subnetwork> - tcp
Established IntegerIdle Timeout Sec - tcp
Time IntegerWait Timeout Sec - tcp
Transitory IntegerIdle Timeout Sec - type String
- udp
Idle IntegerTimeout Sec - project String
- region String
- auto
Network stringTier - drain
Nat string[]Ips - enable
Dynamic booleanPort Allocation - enable
Endpoint booleanIndependent Mapping - endpoint
Types string[] - icmp
Idle numberTimeout Sec - id string
- The provider-assigned unique ID for this managed resource.
- log
Configs GetRouter Nat Log Config[] - max
Ports numberPer Vm - min
Ports numberPer Vm - name string
- nat
Ip stringAllocate Option - nat
Ips string[] - router string
- rules
Get
Router Nat Rule[] - source
Subnetwork stringIp Ranges To Nat - subnetworks
Get
Router Nat Subnetwork[] - tcp
Established numberIdle Timeout Sec - tcp
Time numberWait Timeout Sec - tcp
Transitory numberIdle Timeout Sec - type string
- udp
Idle numberTimeout Sec - project string
- region string
- auto_
network_ strtier - drain_
nat_ Sequence[str]ips - enable_
dynamic_ boolport_ allocation - enable_
endpoint_ boolindependent_ mapping - endpoint_
types Sequence[str] - icmp_
idle_ inttimeout_ sec - id str
- The provider-assigned unique ID for this managed resource.
- log_
configs Sequence[GetRouter Nat Log Config] - max_
ports_ intper_ vm - min_
ports_ intper_ vm - name str
- nat_
ip_ strallocate_ option - nat_
ips Sequence[str] - router str
- rules
Sequence[Get
Router Nat Rule] - source_
subnetwork_ strip_ ranges_ to_ nat - subnetworks
Sequence[Get
Router Nat Subnetwork] - tcp_
established_ intidle_ timeout_ sec - tcp_
time_ intwait_ timeout_ sec - tcp_
transitory_ intidle_ timeout_ sec - type str
- udp_
idle_ inttimeout_ sec - project str
- region str
- auto
Network StringTier - drain
Nat List<String>Ips - enable
Dynamic BooleanPort Allocation - enable
Endpoint BooleanIndependent Mapping - endpoint
Types List<String> - icmp
Idle NumberTimeout Sec - id String
- The provider-assigned unique ID for this managed resource.
- log
Configs List<Property Map> - max
Ports NumberPer Vm - min
Ports NumberPer Vm - name String
- nat
Ip StringAllocate Option - nat
Ips List<String> - router String
- rules List<Property Map>
- source
Subnetwork StringIp Ranges To Nat - subnetworks List<Property Map>
- tcp
Established NumberIdle Timeout Sec - tcp
Time NumberWait Timeout Sec - tcp
Transitory NumberIdle Timeout Sec - type String
- udp
Idle NumberTimeout Sec - project String
- region String
Supporting Types
GetRouterNatLogConfig
GetRouterNatRule
- Actions
List<Get
Router Nat Rule Action> - The action to be enforced for traffic that matches this rule.
- Description string
- An optional description of this rule.
- Match string
CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding action is enforced.
The following examples are valid match expressions for public NAT:
"inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')"
"destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'"
The following example is a valid match expression for private NAT:
"nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
- Rule
Number int - An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
- Actions
[]Get
Router Nat Rule Action - The action to be enforced for traffic that matches this rule.
- Description string
- An optional description of this rule.
- Match string
CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding action is enforced.
The following examples are valid match expressions for public NAT:
"inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')"
"destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'"
The following example is a valid match expression for private NAT:
"nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
- Rule
Number int - An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
- actions
List<Get
Router Nat Rule Action> - The action to be enforced for traffic that matches this rule.
- description String
- An optional description of this rule.
- match String
CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding action is enforced.
The following examples are valid match expressions for public NAT:
"inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')"
"destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'"
The following example is a valid match expression for private NAT:
"nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
- rule
Number Integer - An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
- actions
Get
Router Nat Rule Action[] - The action to be enforced for traffic that matches this rule.
- description string
- An optional description of this rule.
- match string
CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding action is enforced.
The following examples are valid match expressions for public NAT:
"inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')"
"destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'"
The following example is a valid match expression for private NAT:
"nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
- rule
Number number - An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
- actions
Sequence[Get
Router Nat Rule Action] - The action to be enforced for traffic that matches this rule.
- description str
- An optional description of this rule.
- match str
CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding action is enforced.
The following examples are valid match expressions for public NAT:
"inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')"
"destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'"
The following example is a valid match expression for private NAT:
"nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
- rule_
number int - An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
- actions List<Property Map>
- The action to be enforced for traffic that matches this rule.
- description String
- An optional description of this rule.
- match String
CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding action is enforced.
The following examples are valid match expressions for public NAT:
"inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')"
"destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'"
The following example is a valid match expression for private NAT:
"nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
- rule
Number Number - An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
GetRouterNatRuleAction
- Source
Nat List<string>Active Ips - A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.
- Source
Nat List<string>Active Ranges - A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.
- Source
Nat List<string>Drain 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. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.
- Source
Nat List<string>Drain Ranges - A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.
- Source
Nat []stringActive Ips - A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.
- Source
Nat []stringActive Ranges - A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.
- Source
Nat []stringDrain 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. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.
- Source
Nat []stringDrain Ranges - A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.
- source
Nat List<String>Active Ips - A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.
- source
Nat List<String>Active Ranges - A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.
- source
Nat List<String>Drain 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. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.
- source
Nat List<String>Drain Ranges - A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.
- source
Nat string[]Active Ips - A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.
- source
Nat string[]Active Ranges - A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.
- source
Nat string[]Drain 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. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.
- source
Nat string[]Drain Ranges - A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.
- source_
nat_ Sequence[str]active_ ips - A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.
- source_
nat_ Sequence[str]active_ ranges - A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.
- source_
nat_ Sequence[str]drain_ 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. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.
- source_
nat_ Sequence[str]drain_ ranges - A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.
- source
Nat List<String>Active Ips - A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT.
- source
Nat List<String>Active Ranges - A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT.
- source
Nat List<String>Drain 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. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT.
- source
Nat List<String>Drain Ranges - A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT.
GetRouterNatSubnetwork
- Name string
- Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
- 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_RANGES' is one of the values in sourceIpRangesToNat
- 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'.
- Name string
- Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
- 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_RANGES' is one of the values in sourceIpRangesToNat
- 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'.
- name String
- Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
- 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_RANGES' is one of the values in sourceIpRangesToNat
- 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'.
- name string
- Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
- 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_RANGES' is one of the values in sourceIpRangesToNat
- 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'.
- name str
- Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
- secondary_
ip_ Sequence[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_RANGES' is one of the values in sourceIpRangesToNat
- source_
ip_ Sequence[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'.
- name String
- Name of the NAT service. The name must be 1-63 characters long and comply with RFC1035.
- 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_RANGES' is one of the values in sourceIpRangesToNat
- 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'.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.