1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. RouterNatAddress
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

gcp.compute.RouterNatAddress

Explore with Pulumi AI

A resource used to set the list of IP addresses to be used in a NAT service and manage the draining of destroyed IPs.

Note: This resource is to be used alongside a gcp.compute.RouterNat resource, the router nat resource must have no defined nat_ips or drain_nat_ips parameters, instead using the initial_nat_ips parameter to set at least one IP for the creation of the resource.

To get more information about RouterNatAddress, see:

Example Usage

Create RouterNatAddress Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new RouterNatAddress(name: string, args: RouterNatAddressArgs, opts?: CustomResourceOptions);
@overload
def RouterNatAddress(resource_name: str,
                     args: RouterNatAddressArgs,
                     opts: Optional[ResourceOptions] = None)

@overload
def RouterNatAddress(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     nat_ips: Optional[Sequence[str]] = None,
                     router: Optional[str] = None,
                     router_nat: Optional[str] = None,
                     drain_nat_ips: Optional[Sequence[str]] = None,
                     project: Optional[str] = None,
                     region: Optional[str] = None)
func NewRouterNatAddress(ctx *Context, name string, args RouterNatAddressArgs, opts ...ResourceOption) (*RouterNatAddress, error)
public RouterNatAddress(string name, RouterNatAddressArgs args, CustomResourceOptions? opts = null)
public RouterNatAddress(String name, RouterNatAddressArgs args)
public RouterNatAddress(String name, RouterNatAddressArgs args, CustomResourceOptions options)
type: gcp:compute:RouterNatAddress
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RouterNatAddressArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RouterNatAddressArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RouterNatAddressArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RouterNatAddressArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RouterNatAddressArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var routerNatAddressResource = new Gcp.Compute.RouterNatAddress("routerNatAddressResource", new()
{
    NatIps = new[]
    {
        "string",
    },
    Router = "string",
    RouterNat = "string",
    DrainNatIps = new[]
    {
        "string",
    },
    Project = "string",
    Region = "string",
});
Copy
example, err := compute.NewRouterNatAddress(ctx, "routerNatAddressResource", &compute.RouterNatAddressArgs{
	NatIps: pulumi.StringArray{
		pulumi.String("string"),
	},
	Router:    pulumi.String("string"),
	RouterNat: pulumi.String("string"),
	DrainNatIps: pulumi.StringArray{
		pulumi.String("string"),
	},
	Project: pulumi.String("string"),
	Region:  pulumi.String("string"),
})
Copy
var routerNatAddressResource = new RouterNatAddress("routerNatAddressResource", RouterNatAddressArgs.builder()
    .natIps("string")
    .router("string")
    .routerNat("string")
    .drainNatIps("string")
    .project("string")
    .region("string")
    .build());
Copy
router_nat_address_resource = gcp.compute.RouterNatAddress("routerNatAddressResource",
    nat_ips=["string"],
    router="string",
    router_nat="string",
    drain_nat_ips=["string"],
    project="string",
    region="string")
Copy
const routerNatAddressResource = new gcp.compute.RouterNatAddress("routerNatAddressResource", {
    natIps: ["string"],
    router: "string",
    routerNat: "string",
    drainNatIps: ["string"],
    project: "string",
    region: "string",
});
Copy
type: gcp:compute:RouterNatAddress
properties:
    drainNatIps:
        - string
    natIps:
        - string
    project: string
    region: string
    router: string
    routerNat: string
Copy

RouterNatAddress Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The RouterNatAddress resource accepts the following input properties:

NatIps This property is required. List<string>
Self-links of NAT IPs to be used in a Nat service. Only valid if the referenced RouterNat natIpAllocateOption is set to MANUAL_ONLY.
Router
This property is required.
Changes to this property will trigger replacement.
string
The name of the Cloud Router in which the referenced NAT service is configured.
RouterNat
This property is required.
Changes to this property will trigger replacement.
string
The name of the Nat service in which this address will be configured.


DrainNatIps 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.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
Region where the NAT service reside.
NatIps This property is required. []string
Self-links of NAT IPs to be used in a Nat service. Only valid if the referenced RouterNat natIpAllocateOption is set to MANUAL_ONLY.
Router
This property is required.
Changes to this property will trigger replacement.
string
The name of the Cloud Router in which the referenced NAT service is configured.
RouterNat
This property is required.
Changes to this property will trigger replacement.
string
The name of the Nat service in which this address will be configured.


DrainNatIps []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.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
Region where the NAT service reside.
natIps This property is required. List<String>
Self-links of NAT IPs to be used in a Nat service. Only valid if the referenced RouterNat natIpAllocateOption is set to MANUAL_ONLY.
router
This property is required.
Changes to this property will trigger replacement.
String
The name of the Cloud Router in which the referenced NAT service is configured.
routerNat
This property is required.
Changes to this property will trigger replacement.
String
The name of the Nat service in which this address will be configured.


drainNatIps 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.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
Region where the NAT service reside.
natIps This property is required. string[]
Self-links of NAT IPs to be used in a Nat service. Only valid if the referenced RouterNat natIpAllocateOption is set to MANUAL_ONLY.
router
This property is required.
Changes to this property will trigger replacement.
string
The name of the Cloud Router in which the referenced NAT service is configured.
routerNat
This property is required.
Changes to this property will trigger replacement.
string
The name of the Nat service in which this address will be configured.


drainNatIps 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.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. string
Region where the NAT service reside.
nat_ips This property is required. Sequence[str]
Self-links of NAT IPs to be used in a Nat service. Only valid if the referenced RouterNat natIpAllocateOption is set to MANUAL_ONLY.
router
This property is required.
Changes to this property will trigger replacement.
str
The name of the Cloud Router in which the referenced NAT service is configured.
router_nat
This property is required.
Changes to this property will trigger replacement.
str
The name of the Nat service in which this address will be configured.


drain_nat_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.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. str
Region where the NAT service reside.
natIps This property is required. List<String>
Self-links of NAT IPs to be used in a Nat service. Only valid if the referenced RouterNat natIpAllocateOption is set to MANUAL_ONLY.
router
This property is required.
Changes to this property will trigger replacement.
String
The name of the Cloud Router in which the referenced NAT service is configured.
routerNat
This property is required.
Changes to this property will trigger replacement.
String
The name of the Nat service in which this address will be configured.


drainNatIps 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.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
Region where the NAT service reside.

Outputs

All input properties are implicitly available as output properties. Additionally, the RouterNatAddress resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing RouterNatAddress Resource

Get an existing RouterNatAddress 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?: RouterNatAddressState, opts?: CustomResourceOptions): RouterNatAddress
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        drain_nat_ips: Optional[Sequence[str]] = None,
        nat_ips: Optional[Sequence[str]] = None,
        project: Optional[str] = None,
        region: Optional[str] = None,
        router: Optional[str] = None,
        router_nat: Optional[str] = None) -> RouterNatAddress
func GetRouterNatAddress(ctx *Context, name string, id IDInput, state *RouterNatAddressState, opts ...ResourceOption) (*RouterNatAddress, error)
public static RouterNatAddress Get(string name, Input<string> id, RouterNatAddressState? state, CustomResourceOptions? opts = null)
public static RouterNatAddress get(String name, Output<String> id, RouterNatAddressState state, CustomResourceOptions options)
resources:  _:    type: gcp:compute:RouterNatAddress    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
DrainNatIps 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.
NatIps List<string>
Self-links of NAT IPs to be used in a Nat service. Only valid if the referenced RouterNat natIpAllocateOption is set to MANUAL_ONLY.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
Region where the NAT service reside.
Router Changes to this property will trigger replacement. string
The name of the Cloud Router in which the referenced NAT service is configured.
RouterNat Changes to this property will trigger replacement. string
The name of the Nat service in which this address will be configured.


DrainNatIps []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.
NatIps []string
Self-links of NAT IPs to be used in a Nat service. Only valid if the referenced RouterNat natIpAllocateOption is set to MANUAL_ONLY.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region Changes to this property will trigger replacement. string
Region where the NAT service reside.
Router Changes to this property will trigger replacement. string
The name of the Cloud Router in which the referenced NAT service is configured.
RouterNat Changes to this property will trigger replacement. string
The name of the Nat service in which this address will be configured.


drainNatIps 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.
natIps List<String>
Self-links of NAT IPs to be used in a Nat service. Only valid if the referenced RouterNat natIpAllocateOption is set to MANUAL_ONLY.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
Region where the NAT service reside.
router Changes to this property will trigger replacement. String
The name of the Cloud Router in which the referenced NAT service is configured.
routerNat Changes to this property will trigger replacement. String
The name of the Nat service in which this address will be configured.


drainNatIps 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.
natIps string[]
Self-links of NAT IPs to be used in a Nat service. Only valid if the referenced RouterNat natIpAllocateOption is set to MANUAL_ONLY.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. string
Region where the NAT service reside.
router Changes to this property will trigger replacement. string
The name of the Cloud Router in which the referenced NAT service is configured.
routerNat Changes to this property will trigger replacement. string
The name of the Nat service in which this address will be configured.


drain_nat_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.
nat_ips Sequence[str]
Self-links of NAT IPs to be used in a Nat service. Only valid if the referenced RouterNat natIpAllocateOption is set to MANUAL_ONLY.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. str
Region where the NAT service reside.
router Changes to this property will trigger replacement. str
The name of the Cloud Router in which the referenced NAT service is configured.
router_nat Changes to this property will trigger replacement. str
The name of the Nat service in which this address will be configured.


drainNatIps 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.
natIps List<String>
Self-links of NAT IPs to be used in a Nat service. Only valid if the referenced RouterNat natIpAllocateOption is set to MANUAL_ONLY.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region Changes to this property will trigger replacement. String
Region where the NAT service reside.
router Changes to this property will trigger replacement. String
The name of the Cloud Router in which the referenced NAT service is configured.
routerNat Changes to this property will trigger replacement. String
The name of the Nat service in which this address will be configured.


Import

RouterNatAddress can be imported using any of these accepted formats:

  • projects/{{project}}/regions/{{region}}/routers/{{router}}/{{router_nat}}

  • {{project}}/{{region}}/{{router}}/{{router_nat}}

  • {{region}}/{{router}}/{{router_nat}}

  • {{router}}/{{router_nat}}

When using the pulumi import command, RouterNatAddress can be imported using one of the formats above. For example:

$ pulumi import gcp:compute/routerNatAddress:RouterNatAddress default projects/{{project}}/regions/{{region}}/routers/{{router}}/{{router_nat}}
Copy
$ pulumi import gcp:compute/routerNatAddress:RouterNatAddress default {{project}}/{{region}}/{{router}}/{{router_nat}}
Copy
$ pulumi import gcp:compute/routerNatAddress:RouterNatAddress default {{region}}/{{router}}/{{router_nat}}
Copy
$ pulumi import gcp:compute/routerNatAddress:RouterNatAddress default {{router}}/{{router_nat}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

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.