1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getRouterNat
Google Cloud Classic v7.28.0 published on Friday, Jun 21, 2024 by Pulumi

gcp.compute.getRouterNat

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.28.0 published on Friday, Jun 21, 2024 by Pulumi

    To get more information about Snapshot, see:

    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/v7/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:

    Supporting Types

    GetRouterNatLogConfig

    Enable bool
    Indicates whether or not to export logs.
    Filter string
    Specifies the desired filtering of logs on this NAT. Possible values: ["ERRORS_ONLY", "TRANSLATIONS_ONLY", "ALL"]
    Enable bool
    Indicates whether or not to export logs.
    Filter string
    Specifies the desired filtering of logs on this NAT. Possible values: ["ERRORS_ONLY", "TRANSLATIONS_ONLY", "ALL"]
    enable Boolean
    Indicates whether or not to export logs.
    filter String
    Specifies the desired filtering of logs on this NAT. Possible values: ["ERRORS_ONLY", "TRANSLATIONS_ONLY", "ALL"]
    enable boolean
    Indicates whether or not to export logs.
    filter string
    Specifies the desired filtering of logs on this NAT. Possible values: ["ERRORS_ONLY", "TRANSLATIONS_ONLY", "ALL"]
    enable bool
    Indicates whether or not to export logs.
    filter str
    Specifies the desired filtering of logs on this NAT. Possible values: ["ERRORS_ONLY", "TRANSLATIONS_ONLY", "ALL"]
    enable Boolean
    Indicates whether or not to export logs.
    filter String
    Specifies the desired filtering of logs on this NAT. Possible values: ["ERRORS_ONLY", "TRANSLATIONS_ONLY", "ALL"]

    GetRouterNatRule

    Actions List<GetRouterNatRuleAction>
    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'"

    RuleNumber 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 []GetRouterNatRuleAction
    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'"

    RuleNumber 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<GetRouterNatRuleAction>
    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'"

    ruleNumber 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 GetRouterNatRuleAction[]
    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'"

    ruleNumber 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[GetRouterNatRuleAction]
    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'"

    ruleNumber 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

    SourceNatActiveIps List<string>
    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.
    SourceNatActiveRanges List<string>
    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.
    SourceNatDrainIps List<string>
    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.
    SourceNatDrainRanges List<string>
    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.
    SourceNatActiveIps []string
    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.
    SourceNatActiveRanges []string
    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.
    SourceNatDrainIps []string
    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.
    SourceNatDrainRanges []string
    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.
    sourceNatActiveIps List<String>
    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.
    sourceNatActiveRanges List<String>
    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.
    sourceNatDrainIps List<String>
    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.
    sourceNatDrainRanges List<String>
    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.
    sourceNatActiveIps string[]
    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.
    sourceNatActiveRanges string[]
    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.
    sourceNatDrainIps string[]
    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.
    sourceNatDrainRanges string[]
    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_active_ips Sequence[str]
    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_active_ranges Sequence[str]
    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_drain_ips Sequence[str]
    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_drain_ranges Sequence[str]
    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.
    sourceNatActiveIps List<String>
    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.
    sourceNatActiveRanges List<String>
    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.
    sourceNatDrainIps List<String>
    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.
    sourceNatDrainRanges List<String>
    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.
    SecondaryIpRangeNames List<string>
    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
    SourceIpRangesToNats List<string>
    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.
    SecondaryIpRangeNames []string
    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
    SourceIpRangesToNats []string
    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.
    secondaryIpRangeNames List<String>
    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
    sourceIpRangesToNats List<String>
    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.
    secondaryIpRangeNames string[]
    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
    sourceIpRangesToNats string[]
    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_range_names Sequence[str]
    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_ranges_to_nats Sequence[str]
    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.
    secondaryIpRangeNames List<String>
    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
    sourceIpRangesToNats List<String>
    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.
    gcp logo
    Google Cloud Classic v7.28.0 published on Friday, Jun 21, 2024 by Pulumi