1. Packages
  2. Opentelekomcloud Provider
  3. API Docs
  4. NatGatewayV2
opentelekomcloud 1.36.35 published on Monday, Apr 14, 2025 by opentelekomcloud

opentelekomcloud.NatGatewayV2

Explore with Pulumi AI

Up-to-date reference of API arguments for NAT gateway you can get at documentation portal

Manages a V2 NAT Gateway resource within OpenTelekomCloud.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";

const config = new pulumi.Config();
const routerId = config.requireObject("routerId");
const internalNetworkId = config.requireObject("internalNetworkId");
const _this = new opentelekomcloud.NatGatewayV2("this", {
    description: "NAT GW created by terraform",
    spec: "0",
    routerId: routerId,
    internalNetworkId: internalNetworkId,
    tags: {
        muh: "kuh",
    },
});
Copy
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud

config = pulumi.Config()
router_id = config.require_object("routerId")
internal_network_id = config.require_object("internalNetworkId")
this = opentelekomcloud.NatGatewayV2("this",
    description="NAT GW created by terraform",
    spec="0",
    router_id=router_id,
    internal_network_id=internal_network_id,
    tags={
        "muh": "kuh",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		routerId := cfg.RequireObject("routerId")
		internalNetworkId := cfg.RequireObject("internalNetworkId")
		_, err := opentelekomcloud.NewNatGatewayV2(ctx, "this", &opentelekomcloud.NatGatewayV2Args{
			Description:       pulumi.String("NAT GW created by terraform"),
			Spec:              pulumi.String("0"),
			RouterId:          pulumi.Any(routerId),
			InternalNetworkId: pulumi.Any(internalNetworkId),
			Tags: pulumi.StringMap{
				"muh": pulumi.String("kuh"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var routerId = config.RequireObject<dynamic>("routerId");
    var internalNetworkId = config.RequireObject<dynamic>("internalNetworkId");
    var @this = new Opentelekomcloud.NatGatewayV2("this", new()
    {
        Description = "NAT GW created by terraform",
        Spec = "0",
        RouterId = routerId,
        InternalNetworkId = internalNetworkId,
        Tags = 
        {
            { "muh", "kuh" },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.NatGatewayV2;
import com.pulumi.opentelekomcloud.NatGatewayV2Args;
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 config = ctx.config();
        final var routerId = config.get("routerId");
        final var internalNetworkId = config.get("internalNetworkId");
        var this_ = new NatGatewayV2("this", NatGatewayV2Args.builder()
            .description("NAT GW created by terraform")
            .spec("0")
            .routerId(routerId)
            .internalNetworkId(internalNetworkId)
            .tags(Map.of("muh", "kuh"))
            .build());

    }
}
Copy
configuration:
  routerId:
    type: dynamic
  internalNetworkId:
    type: dynamic
resources:
  this:
    type: opentelekomcloud:NatGatewayV2
    properties:
      description: NAT GW created by terraform
      spec: '0'
      routerId: ${routerId}
      internalNetworkId: ${internalNetworkId}
      tags:
        muh: kuh
Copy

Create NatGatewayV2 Resource

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

Constructor syntax

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

@overload
def NatGatewayV2(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 internal_network_id: Optional[str] = None,
                 router_id: Optional[str] = None,
                 spec: Optional[str] = None,
                 description: Optional[str] = None,
                 name: Optional[str] = None,
                 nat_gateway_v2_id: Optional[str] = None,
                 region: Optional[str] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 tenant_id: Optional[str] = None,
                 timeouts: Optional[NatGatewayV2TimeoutsArgs] = None)
func NewNatGatewayV2(ctx *Context, name string, args NatGatewayV2Args, opts ...ResourceOption) (*NatGatewayV2, error)
public NatGatewayV2(string name, NatGatewayV2Args args, CustomResourceOptions? opts = null)
public NatGatewayV2(String name, NatGatewayV2Args args)
public NatGatewayV2(String name, NatGatewayV2Args args, CustomResourceOptions options)
type: opentelekomcloud:NatGatewayV2
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. NatGatewayV2Args
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. NatGatewayV2Args
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. NatGatewayV2Args
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. NatGatewayV2Args
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. NatGatewayV2Args
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 natGatewayV2Resource = new Opentelekomcloud.NatGatewayV2("natGatewayV2Resource", new()
{
    InternalNetworkId = "string",
    RouterId = "string",
    Spec = "string",
    Description = "string",
    Name = "string",
    NatGatewayV2Id = "string",
    Region = "string",
    Tags = 
    {
        { "string", "string" },
    },
    TenantId = "string",
    Timeouts = new Opentelekomcloud.Inputs.NatGatewayV2TimeoutsArgs
    {
        Create = "string",
        Delete = "string",
    },
});
Copy
example, err := opentelekomcloud.NewNatGatewayV2(ctx, "natGatewayV2Resource", &opentelekomcloud.NatGatewayV2Args{
	InternalNetworkId: pulumi.String("string"),
	RouterId:          pulumi.String("string"),
	Spec:              pulumi.String("string"),
	Description:       pulumi.String("string"),
	Name:              pulumi.String("string"),
	NatGatewayV2Id:    pulumi.String("string"),
	Region:            pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	TenantId: pulumi.String("string"),
	Timeouts: &opentelekomcloud.NatGatewayV2TimeoutsArgs{
		Create: pulumi.String("string"),
		Delete: pulumi.String("string"),
	},
})
Copy
var natGatewayV2Resource = new NatGatewayV2("natGatewayV2Resource", NatGatewayV2Args.builder()
    .internalNetworkId("string")
    .routerId("string")
    .spec("string")
    .description("string")
    .name("string")
    .natGatewayV2Id("string")
    .region("string")
    .tags(Map.of("string", "string"))
    .tenantId("string")
    .timeouts(NatGatewayV2TimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .build())
    .build());
Copy
nat_gateway_v2_resource = opentelekomcloud.NatGatewayV2("natGatewayV2Resource",
    internal_network_id="string",
    router_id="string",
    spec="string",
    description="string",
    name="string",
    nat_gateway_v2_id="string",
    region="string",
    tags={
        "string": "string",
    },
    tenant_id="string",
    timeouts={
        "create": "string",
        "delete": "string",
    })
Copy
const natGatewayV2Resource = new opentelekomcloud.NatGatewayV2("natGatewayV2Resource", {
    internalNetworkId: "string",
    routerId: "string",
    spec: "string",
    description: "string",
    name: "string",
    natGatewayV2Id: "string",
    region: "string",
    tags: {
        string: "string",
    },
    tenantId: "string",
    timeouts: {
        create: "string",
        "delete": "string",
    },
});
Copy
type: opentelekomcloud:NatGatewayV2
properties:
    description: string
    internalNetworkId: string
    name: string
    natGatewayV2Id: string
    region: string
    routerId: string
    spec: string
    tags:
        string: string
    tenantId: string
    timeouts:
        create: string
        delete: string
Copy

NatGatewayV2 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 NatGatewayV2 resource accepts the following input properties:

InternalNetworkId This property is required. string
ID of the network this NAT Gateway connects to. Changing this creates a new NAT Gateway.
RouterId This property is required. string
ID of the router (or VPC) this NAT Gateway belongs to. Changing this creates a new NAT Gateway.
Spec This property is required. string
The specification of the NAT Gateway, valid values are "0","1", "2", "3", "4".
Description string
The description of the NAT Gateway.
Name string
The name of the NAT Gateway.
NatGatewayV2Id string
Region string
Tags Dictionary<string, string>
Tags key/value pairs to associate with the NAT Gateway.
TenantId string
The target tenant ID in which to allocate the NAT Gateway. Changing this creates a new NAT Gateway.
Timeouts NatGatewayV2Timeouts
InternalNetworkId This property is required. string
ID of the network this NAT Gateway connects to. Changing this creates a new NAT Gateway.
RouterId This property is required. string
ID of the router (or VPC) this NAT Gateway belongs to. Changing this creates a new NAT Gateway.
Spec This property is required. string
The specification of the NAT Gateway, valid values are "0","1", "2", "3", "4".
Description string
The description of the NAT Gateway.
Name string
The name of the NAT Gateway.
NatGatewayV2Id string
Region string
Tags map[string]string
Tags key/value pairs to associate with the NAT Gateway.
TenantId string
The target tenant ID in which to allocate the NAT Gateway. Changing this creates a new NAT Gateway.
Timeouts NatGatewayV2TimeoutsArgs
internalNetworkId This property is required. String
ID of the network this NAT Gateway connects to. Changing this creates a new NAT Gateway.
routerId This property is required. String
ID of the router (or VPC) this NAT Gateway belongs to. Changing this creates a new NAT Gateway.
spec This property is required. String
The specification of the NAT Gateway, valid values are "0","1", "2", "3", "4".
description String
The description of the NAT Gateway.
name String
The name of the NAT Gateway.
natGatewayV2Id String
region String
tags Map<String,String>
Tags key/value pairs to associate with the NAT Gateway.
tenantId String
The target tenant ID in which to allocate the NAT Gateway. Changing this creates a new NAT Gateway.
timeouts NatGatewayV2Timeouts
internalNetworkId This property is required. string
ID of the network this NAT Gateway connects to. Changing this creates a new NAT Gateway.
routerId This property is required. string
ID of the router (or VPC) this NAT Gateway belongs to. Changing this creates a new NAT Gateway.
spec This property is required. string
The specification of the NAT Gateway, valid values are "0","1", "2", "3", "4".
description string
The description of the NAT Gateway.
name string
The name of the NAT Gateway.
natGatewayV2Id string
region string
tags {[key: string]: string}
Tags key/value pairs to associate with the NAT Gateway.
tenantId string
The target tenant ID in which to allocate the NAT Gateway. Changing this creates a new NAT Gateway.
timeouts NatGatewayV2Timeouts
internal_network_id This property is required. str
ID of the network this NAT Gateway connects to. Changing this creates a new NAT Gateway.
router_id This property is required. str
ID of the router (or VPC) this NAT Gateway belongs to. Changing this creates a new NAT Gateway.
spec This property is required. str
The specification of the NAT Gateway, valid values are "0","1", "2", "3", "4".
description str
The description of the NAT Gateway.
name str
The name of the NAT Gateway.
nat_gateway_v2_id str
region str
tags Mapping[str, str]
Tags key/value pairs to associate with the NAT Gateway.
tenant_id str
The target tenant ID in which to allocate the NAT Gateway. Changing this creates a new NAT Gateway.
timeouts NatGatewayV2TimeoutsArgs
internalNetworkId This property is required. String
ID of the network this NAT Gateway connects to. Changing this creates a new NAT Gateway.
routerId This property is required. String
ID of the router (or VPC) this NAT Gateway belongs to. Changing this creates a new NAT Gateway.
spec This property is required. String
The specification of the NAT Gateway, valid values are "0","1", "2", "3", "4".
description String
The description of the NAT Gateway.
name String
The name of the NAT Gateway.
natGatewayV2Id String
region String
tags Map<String>
Tags key/value pairs to associate with the NAT Gateway.
tenantId String
The target tenant ID in which to allocate the NAT Gateway. Changing this creates a new NAT Gateway.
timeouts Property Map

Outputs

All input properties are implicitly available as output properties. Additionally, the NatGatewayV2 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 NatGatewayV2 Resource

Get an existing NatGatewayV2 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?: NatGatewayV2State, opts?: CustomResourceOptions): NatGatewayV2
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        internal_network_id: Optional[str] = None,
        name: Optional[str] = None,
        nat_gateway_v2_id: Optional[str] = None,
        region: Optional[str] = None,
        router_id: Optional[str] = None,
        spec: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tenant_id: Optional[str] = None,
        timeouts: Optional[NatGatewayV2TimeoutsArgs] = None) -> NatGatewayV2
func GetNatGatewayV2(ctx *Context, name string, id IDInput, state *NatGatewayV2State, opts ...ResourceOption) (*NatGatewayV2, error)
public static NatGatewayV2 Get(string name, Input<string> id, NatGatewayV2State? state, CustomResourceOptions? opts = null)
public static NatGatewayV2 get(String name, Output<String> id, NatGatewayV2State state, CustomResourceOptions options)
resources:  _:    type: opentelekomcloud:NatGatewayV2    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:
Description string
The description of the NAT Gateway.
InternalNetworkId string
ID of the network this NAT Gateway connects to. Changing this creates a new NAT Gateway.
Name string
The name of the NAT Gateway.
NatGatewayV2Id string
Region string
RouterId string
ID of the router (or VPC) this NAT Gateway belongs to. Changing this creates a new NAT Gateway.
Spec string
The specification of the NAT Gateway, valid values are "0","1", "2", "3", "4".
Tags Dictionary<string, string>
Tags key/value pairs to associate with the NAT Gateway.
TenantId string
The target tenant ID in which to allocate the NAT Gateway. Changing this creates a new NAT Gateway.
Timeouts NatGatewayV2Timeouts
Description string
The description of the NAT Gateway.
InternalNetworkId string
ID of the network this NAT Gateway connects to. Changing this creates a new NAT Gateway.
Name string
The name of the NAT Gateway.
NatGatewayV2Id string
Region string
RouterId string
ID of the router (or VPC) this NAT Gateway belongs to. Changing this creates a new NAT Gateway.
Spec string
The specification of the NAT Gateway, valid values are "0","1", "2", "3", "4".
Tags map[string]string
Tags key/value pairs to associate with the NAT Gateway.
TenantId string
The target tenant ID in which to allocate the NAT Gateway. Changing this creates a new NAT Gateway.
Timeouts NatGatewayV2TimeoutsArgs
description String
The description of the NAT Gateway.
internalNetworkId String
ID of the network this NAT Gateway connects to. Changing this creates a new NAT Gateway.
name String
The name of the NAT Gateway.
natGatewayV2Id String
region String
routerId String
ID of the router (or VPC) this NAT Gateway belongs to. Changing this creates a new NAT Gateway.
spec String
The specification of the NAT Gateway, valid values are "0","1", "2", "3", "4".
tags Map<String,String>
Tags key/value pairs to associate with the NAT Gateway.
tenantId String
The target tenant ID in which to allocate the NAT Gateway. Changing this creates a new NAT Gateway.
timeouts NatGatewayV2Timeouts
description string
The description of the NAT Gateway.
internalNetworkId string
ID of the network this NAT Gateway connects to. Changing this creates a new NAT Gateway.
name string
The name of the NAT Gateway.
natGatewayV2Id string
region string
routerId string
ID of the router (or VPC) this NAT Gateway belongs to. Changing this creates a new NAT Gateway.
spec string
The specification of the NAT Gateway, valid values are "0","1", "2", "3", "4".
tags {[key: string]: string}
Tags key/value pairs to associate with the NAT Gateway.
tenantId string
The target tenant ID in which to allocate the NAT Gateway. Changing this creates a new NAT Gateway.
timeouts NatGatewayV2Timeouts
description str
The description of the NAT Gateway.
internal_network_id str
ID of the network this NAT Gateway connects to. Changing this creates a new NAT Gateway.
name str
The name of the NAT Gateway.
nat_gateway_v2_id str
region str
router_id str
ID of the router (or VPC) this NAT Gateway belongs to. Changing this creates a new NAT Gateway.
spec str
The specification of the NAT Gateway, valid values are "0","1", "2", "3", "4".
tags Mapping[str, str]
Tags key/value pairs to associate with the NAT Gateway.
tenant_id str
The target tenant ID in which to allocate the NAT Gateway. Changing this creates a new NAT Gateway.
timeouts NatGatewayV2TimeoutsArgs
description String
The description of the NAT Gateway.
internalNetworkId String
ID of the network this NAT Gateway connects to. Changing this creates a new NAT Gateway.
name String
The name of the NAT Gateway.
natGatewayV2Id String
region String
routerId String
ID of the router (or VPC) this NAT Gateway belongs to. Changing this creates a new NAT Gateway.
spec String
The specification of the NAT Gateway, valid values are "0","1", "2", "3", "4".
tags Map<String>
Tags key/value pairs to associate with the NAT Gateway.
tenantId String
The target tenant ID in which to allocate the NAT Gateway. Changing this creates a new NAT Gateway.
timeouts Property Map

Supporting Types

NatGatewayV2Timeouts
, NatGatewayV2TimeoutsArgs

Create string
Delete string
Create string
Delete string
create String
delete String
create string
delete string
create str
delete str
create String
delete String

Package Details

Repository
opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
License
Notes
This Pulumi package is based on the opentelekomcloud Terraform Provider.