1. Packages
  2. Packages
  3. Volcenginecc Provider
  4. API Docs
  5. natgateway
  6. Dnatentry
Viewing docs for volcenginecc v0.0.32
published on Thursday, Apr 23, 2026 by Volcengine
volcenginecc logo
Viewing docs for volcenginecc v0.0.32
published on Thursday, Apr 23, 2026 by Volcengine

    Destination address translation. When the transit IP and port are accessed, the private NAT gateway replaces the destination address and port in the request with the private IP and port of the cloud server, then forwards the request.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcenginecc from "@volcengine/pulumi-volcenginecc";
    
    const natGatewayDnatentryDemo = new volcenginecc.natgateway.Dnatentry("NatGatewayDnatentryDemo", {
        dnatEntryName: "NatGatewayDnatentryDemo",
        protocol: "udp",
        internalIp: "192.168.xxx.53",
        internalPort: "20-25",
        externalIp: "115.190.xxx.9",
        externalPort: "25-30",
        natGatewayId: "ngw-2pc28yhdpbx8g227qo1sxxxxx",
        portType: "specified",
    });
    
    import pulumi
    import pulumi_volcenginecc as volcenginecc
    
    nat_gateway_dnatentry_demo = volcenginecc.natgateway.Dnatentry("NatGatewayDnatentryDemo",
        dnat_entry_name="NatGatewayDnatentryDemo",
        protocol="udp",
        internal_ip="192.168.xxx.53",
        internal_port="20-25",
        external_ip="115.190.xxx.9",
        external_port="25-30",
        nat_gateway_id="ngw-2pc28yhdpbx8g227qo1sxxxxx",
        port_type="specified")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcenginecc/sdk/go/volcenginecc/natgateway"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := natgateway.NewDnatentry(ctx, "NatGatewayDnatentryDemo", &natgateway.DnatentryArgs{
    			DnatEntryName: pulumi.String("NatGatewayDnatentryDemo"),
    			Protocol:      pulumi.String("udp"),
    			InternalIp:    pulumi.String("192.168.xxx.53"),
    			InternalPort:  pulumi.String("20-25"),
    			ExternalIp:    pulumi.String("115.190.xxx.9"),
    			ExternalPort:  pulumi.String("25-30"),
    			NatGatewayId:  pulumi.String("ngw-2pc28yhdpbx8g227qo1sxxxxx"),
    			PortType:      pulumi.String("specified"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcenginecc = Volcengine.Pulumi.Volcenginecc;
    
    return await Deployment.RunAsync(() => 
    {
        var natGatewayDnatentryDemo = new Volcenginecc.Natgateway.Dnatentry("NatGatewayDnatentryDemo", new()
        {
            DnatEntryName = "NatGatewayDnatentryDemo",
            Protocol = "udp",
            InternalIp = "192.168.xxx.53",
            InternalPort = "20-25",
            ExternalIp = "115.190.xxx.9",
            ExternalPort = "25-30",
            NatGatewayId = "ngw-2pc28yhdpbx8g227qo1sxxxxx",
            PortType = "specified",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.volcengine.volcenginecc.natgateway.Dnatentry;
    import com.volcengine.volcenginecc.natgateway.DnatentryArgs;
    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) {
            var natGatewayDnatentryDemo = new Dnatentry("natGatewayDnatentryDemo", DnatentryArgs.builder()
                .dnatEntryName("NatGatewayDnatentryDemo")
                .protocol("udp")
                .internalIp("192.168.xxx.53")
                .internalPort("20-25")
                .externalIp("115.190.xxx.9")
                .externalPort("25-30")
                .natGatewayId("ngw-2pc28yhdpbx8g227qo1sxxxxx")
                .portType("specified")
                .build());
    
        }
    }
    
    resources:
      natGatewayDnatentryDemo:
        type: volcenginecc:natgateway:Dnatentry
        name: NatGatewayDnatentryDemo
        properties:
          dnatEntryName: NatGatewayDnatentryDemo
          protocol: udp
          internalIp: 192.168.xxx.53
          internalPort: 20-25
          externalIp: 115.190.xxx.9
          externalPort: 25-30
          natGatewayId: ngw-2pc28yhdpbx8g227qo1sxxxxx
          portType: specified
    

    Create Dnatentry Resource

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

    Constructor syntax

    new Dnatentry(name: string, args: DnatentryArgs, opts?: CustomResourceOptions);
    @overload
    def Dnatentry(resource_name: str,
                  args: DnatentryArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def Dnatentry(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  external_ip: Optional[str] = None,
                  external_port: Optional[str] = None,
                  internal_ip: Optional[str] = None,
                  internal_port: Optional[str] = None,
                  nat_gateway_id: Optional[str] = None,
                  protocol: Optional[str] = None,
                  dnat_entry_name: Optional[str] = None,
                  port_type: Optional[str] = None)
    func NewDnatentry(ctx *Context, name string, args DnatentryArgs, opts ...ResourceOption) (*Dnatentry, error)
    public Dnatentry(string name, DnatentryArgs args, CustomResourceOptions? opts = null)
    public Dnatentry(String name, DnatentryArgs args)
    public Dnatentry(String name, DnatentryArgs args, CustomResourceOptions options)
    
    type: volcenginecc:natgateway:Dnatentry
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args DnatentryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args DnatentryArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args DnatentryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DnatentryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DnatentryArgs
    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 dnatentryResource = new Volcenginecc.Natgateway.Dnatentry("dnatentryResource", new()
    {
        ExternalIp = "string",
        ExternalPort = "string",
        InternalIp = "string",
        InternalPort = "string",
        NatGatewayId = "string",
        Protocol = "string",
        DnatEntryName = "string",
        PortType = "string",
    });
    
    example, err := natgateway.NewDnatentry(ctx, "dnatentryResource", &natgateway.DnatentryArgs{
    	ExternalIp:    pulumi.String("string"),
    	ExternalPort:  pulumi.String("string"),
    	InternalIp:    pulumi.String("string"),
    	InternalPort:  pulumi.String("string"),
    	NatGatewayId:  pulumi.String("string"),
    	Protocol:      pulumi.String("string"),
    	DnatEntryName: pulumi.String("string"),
    	PortType:      pulumi.String("string"),
    })
    
    var dnatentryResource = new Dnatentry("dnatentryResource", DnatentryArgs.builder()
        .externalIp("string")
        .externalPort("string")
        .internalIp("string")
        .internalPort("string")
        .natGatewayId("string")
        .protocol("string")
        .dnatEntryName("string")
        .portType("string")
        .build());
    
    dnatentry_resource = volcenginecc.natgateway.Dnatentry("dnatentryResource",
        external_ip="string",
        external_port="string",
        internal_ip="string",
        internal_port="string",
        nat_gateway_id="string",
        protocol="string",
        dnat_entry_name="string",
        port_type="string")
    
    const dnatentryResource = new volcenginecc.natgateway.Dnatentry("dnatentryResource", {
        externalIp: "string",
        externalPort: "string",
        internalIp: "string",
        internalPort: "string",
        natGatewayId: "string",
        protocol: "string",
        dnatEntryName: "string",
        portType: "string",
    });
    
    type: volcenginecc:natgateway:Dnatentry
    properties:
        dnatEntryName: string
        externalIp: string
        externalPort: string
        internalIp: string
        internalPort: string
        natGatewayId: string
        portType: string
        protocol: string
    

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

    ExternalIp string
    IP address used by the NAT gateway for network address translation. If the NAT gateway is a public NAT gateway, enter its bound public IP address. If the NAT gateway is a private NAT gateway, enter its transit IP address.
    ExternalPort string
    Port or port range that receives requests from the public network.
    InternalIp string
    Private IP address of the cloud server instance.
    InternalPort string
    Port or port range of the private IP address of the cloud server instance.
    NatGatewayId string
    ID of the NAT gateway to which the DNAT rule belongs.
    Protocol string
    Protocol type. tcp: Forwards TCP protocol packets. udp: Forwards UDP protocol packets.
    DnatEntryName string
    Name of the DNAT rule.
    PortType string
    Port type of the DNAT rule. specified: Specified port. any: Any port, i.e., IP mapping.
    ExternalIp string
    IP address used by the NAT gateway for network address translation. If the NAT gateway is a public NAT gateway, enter its bound public IP address. If the NAT gateway is a private NAT gateway, enter its transit IP address.
    ExternalPort string
    Port or port range that receives requests from the public network.
    InternalIp string
    Private IP address of the cloud server instance.
    InternalPort string
    Port or port range of the private IP address of the cloud server instance.
    NatGatewayId string
    ID of the NAT gateway to which the DNAT rule belongs.
    Protocol string
    Protocol type. tcp: Forwards TCP protocol packets. udp: Forwards UDP protocol packets.
    DnatEntryName string
    Name of the DNAT rule.
    PortType string
    Port type of the DNAT rule. specified: Specified port. any: Any port, i.e., IP mapping.
    externalIp String
    IP address used by the NAT gateway for network address translation. If the NAT gateway is a public NAT gateway, enter its bound public IP address. If the NAT gateway is a private NAT gateway, enter its transit IP address.
    externalPort String
    Port or port range that receives requests from the public network.
    internalIp String
    Private IP address of the cloud server instance.
    internalPort String
    Port or port range of the private IP address of the cloud server instance.
    natGatewayId String
    ID of the NAT gateway to which the DNAT rule belongs.
    protocol String
    Protocol type. tcp: Forwards TCP protocol packets. udp: Forwards UDP protocol packets.
    dnatEntryName String
    Name of the DNAT rule.
    portType String
    Port type of the DNAT rule. specified: Specified port. any: Any port, i.e., IP mapping.
    externalIp string
    IP address used by the NAT gateway for network address translation. If the NAT gateway is a public NAT gateway, enter its bound public IP address. If the NAT gateway is a private NAT gateway, enter its transit IP address.
    externalPort string
    Port or port range that receives requests from the public network.
    internalIp string
    Private IP address of the cloud server instance.
    internalPort string
    Port or port range of the private IP address of the cloud server instance.
    natGatewayId string
    ID of the NAT gateway to which the DNAT rule belongs.
    protocol string
    Protocol type. tcp: Forwards TCP protocol packets. udp: Forwards UDP protocol packets.
    dnatEntryName string
    Name of the DNAT rule.
    portType string
    Port type of the DNAT rule. specified: Specified port. any: Any port, i.e., IP mapping.
    external_ip str
    IP address used by the NAT gateway for network address translation. If the NAT gateway is a public NAT gateway, enter its bound public IP address. If the NAT gateway is a private NAT gateway, enter its transit IP address.
    external_port str
    Port or port range that receives requests from the public network.
    internal_ip str
    Private IP address of the cloud server instance.
    internal_port str
    Port or port range of the private IP address of the cloud server instance.
    nat_gateway_id str
    ID of the NAT gateway to which the DNAT rule belongs.
    protocol str
    Protocol type. tcp: Forwards TCP protocol packets. udp: Forwards UDP protocol packets.
    dnat_entry_name str
    Name of the DNAT rule.
    port_type str
    Port type of the DNAT rule. specified: Specified port. any: Any port, i.e., IP mapping.
    externalIp String
    IP address used by the NAT gateway for network address translation. If the NAT gateway is a public NAT gateway, enter its bound public IP address. If the NAT gateway is a private NAT gateway, enter its transit IP address.
    externalPort String
    Port or port range that receives requests from the public network.
    internalIp String
    Private IP address of the cloud server instance.
    internalPort String
    Port or port range of the private IP address of the cloud server instance.
    natGatewayId String
    ID of the NAT gateway to which the DNAT rule belongs.
    protocol String
    Protocol type. tcp: Forwards TCP protocol packets. udp: Forwards UDP protocol packets.
    dnatEntryName String
    Name of the DNAT rule.
    portType String
    Port type of the DNAT rule. specified: Specified port. any: Any port, i.e., IP mapping.

    Outputs

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

    DnatEntryId string
    ID of the DNAT rule.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Status of the DNAT rule. Creating: Creating. Deleting: Deleting. Available: Available.
    DnatEntryId string
    ID of the DNAT rule.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Status of the DNAT rule. Creating: Creating. Deleting: Deleting. Available: Available.
    dnatEntryId String
    ID of the DNAT rule.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Status of the DNAT rule. Creating: Creating. Deleting: Deleting. Available: Available.
    dnatEntryId string
    ID of the DNAT rule.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    Status of the DNAT rule. Creating: Creating. Deleting: Deleting. Available: Available.
    dnat_entry_id str
    ID of the DNAT rule.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    Status of the DNAT rule. Creating: Creating. Deleting: Deleting. Available: Available.
    dnatEntryId String
    ID of the DNAT rule.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Status of the DNAT rule. Creating: Creating. Deleting: Deleting. Available: Available.

    Look up Existing Dnatentry Resource

    Get an existing Dnatentry 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?: DnatentryState, opts?: CustomResourceOptions): Dnatentry
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dnat_entry_id: Optional[str] = None,
            dnat_entry_name: Optional[str] = None,
            external_ip: Optional[str] = None,
            external_port: Optional[str] = None,
            internal_ip: Optional[str] = None,
            internal_port: Optional[str] = None,
            nat_gateway_id: Optional[str] = None,
            port_type: Optional[str] = None,
            protocol: Optional[str] = None,
            status: Optional[str] = None) -> Dnatentry
    func GetDnatentry(ctx *Context, name string, id IDInput, state *DnatentryState, opts ...ResourceOption) (*Dnatentry, error)
    public static Dnatentry Get(string name, Input<string> id, DnatentryState? state, CustomResourceOptions? opts = null)
    public static Dnatentry get(String name, Output<String> id, DnatentryState state, CustomResourceOptions options)
    resources:  _:    type: volcenginecc:natgateway:Dnatentry    get:      id: ${id}
    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.
    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:
    DnatEntryId string
    ID of the DNAT rule.
    DnatEntryName string
    Name of the DNAT rule.
    ExternalIp string
    IP address used by the NAT gateway for network address translation. If the NAT gateway is a public NAT gateway, enter its bound public IP address. If the NAT gateway is a private NAT gateway, enter its transit IP address.
    ExternalPort string
    Port or port range that receives requests from the public network.
    InternalIp string
    Private IP address of the cloud server instance.
    InternalPort string
    Port or port range of the private IP address of the cloud server instance.
    NatGatewayId string
    ID of the NAT gateway to which the DNAT rule belongs.
    PortType string
    Port type of the DNAT rule. specified: Specified port. any: Any port, i.e., IP mapping.
    Protocol string
    Protocol type. tcp: Forwards TCP protocol packets. udp: Forwards UDP protocol packets.
    Status string
    Status of the DNAT rule. Creating: Creating. Deleting: Deleting. Available: Available.
    DnatEntryId string
    ID of the DNAT rule.
    DnatEntryName string
    Name of the DNAT rule.
    ExternalIp string
    IP address used by the NAT gateway for network address translation. If the NAT gateway is a public NAT gateway, enter its bound public IP address. If the NAT gateway is a private NAT gateway, enter its transit IP address.
    ExternalPort string
    Port or port range that receives requests from the public network.
    InternalIp string
    Private IP address of the cloud server instance.
    InternalPort string
    Port or port range of the private IP address of the cloud server instance.
    NatGatewayId string
    ID of the NAT gateway to which the DNAT rule belongs.
    PortType string
    Port type of the DNAT rule. specified: Specified port. any: Any port, i.e., IP mapping.
    Protocol string
    Protocol type. tcp: Forwards TCP protocol packets. udp: Forwards UDP protocol packets.
    Status string
    Status of the DNAT rule. Creating: Creating. Deleting: Deleting. Available: Available.
    dnatEntryId String
    ID of the DNAT rule.
    dnatEntryName String
    Name of the DNAT rule.
    externalIp String
    IP address used by the NAT gateway for network address translation. If the NAT gateway is a public NAT gateway, enter its bound public IP address. If the NAT gateway is a private NAT gateway, enter its transit IP address.
    externalPort String
    Port or port range that receives requests from the public network.
    internalIp String
    Private IP address of the cloud server instance.
    internalPort String
    Port or port range of the private IP address of the cloud server instance.
    natGatewayId String
    ID of the NAT gateway to which the DNAT rule belongs.
    portType String
    Port type of the DNAT rule. specified: Specified port. any: Any port, i.e., IP mapping.
    protocol String
    Protocol type. tcp: Forwards TCP protocol packets. udp: Forwards UDP protocol packets.
    status String
    Status of the DNAT rule. Creating: Creating. Deleting: Deleting. Available: Available.
    dnatEntryId string
    ID of the DNAT rule.
    dnatEntryName string
    Name of the DNAT rule.
    externalIp string
    IP address used by the NAT gateway for network address translation. If the NAT gateway is a public NAT gateway, enter its bound public IP address. If the NAT gateway is a private NAT gateway, enter its transit IP address.
    externalPort string
    Port or port range that receives requests from the public network.
    internalIp string
    Private IP address of the cloud server instance.
    internalPort string
    Port or port range of the private IP address of the cloud server instance.
    natGatewayId string
    ID of the NAT gateway to which the DNAT rule belongs.
    portType string
    Port type of the DNAT rule. specified: Specified port. any: Any port, i.e., IP mapping.
    protocol string
    Protocol type. tcp: Forwards TCP protocol packets. udp: Forwards UDP protocol packets.
    status string
    Status of the DNAT rule. Creating: Creating. Deleting: Deleting. Available: Available.
    dnat_entry_id str
    ID of the DNAT rule.
    dnat_entry_name str
    Name of the DNAT rule.
    external_ip str
    IP address used by the NAT gateway for network address translation. If the NAT gateway is a public NAT gateway, enter its bound public IP address. If the NAT gateway is a private NAT gateway, enter its transit IP address.
    external_port str
    Port or port range that receives requests from the public network.
    internal_ip str
    Private IP address of the cloud server instance.
    internal_port str
    Port or port range of the private IP address of the cloud server instance.
    nat_gateway_id str
    ID of the NAT gateway to which the DNAT rule belongs.
    port_type str
    Port type of the DNAT rule. specified: Specified port. any: Any port, i.e., IP mapping.
    protocol str
    Protocol type. tcp: Forwards TCP protocol packets. udp: Forwards UDP protocol packets.
    status str
    Status of the DNAT rule. Creating: Creating. Deleting: Deleting. Available: Available.
    dnatEntryId String
    ID of the DNAT rule.
    dnatEntryName String
    Name of the DNAT rule.
    externalIp String
    IP address used by the NAT gateway for network address translation. If the NAT gateway is a public NAT gateway, enter its bound public IP address. If the NAT gateway is a private NAT gateway, enter its transit IP address.
    externalPort String
    Port or port range that receives requests from the public network.
    internalIp String
    Private IP address of the cloud server instance.
    internalPort String
    Port or port range of the private IP address of the cloud server instance.
    natGatewayId String
    ID of the NAT gateway to which the DNAT rule belongs.
    portType String
    Port type of the DNAT rule. specified: Specified port. any: Any port, i.e., IP mapping.
    protocol String
    Protocol type. tcp: Forwards TCP protocol packets. udp: Forwards UDP protocol packets.
    status String
    Status of the DNAT rule. Creating: Creating. Deleting: Deleting. Available: Available.

    Import

    $ pulumi import volcenginecc:natgateway/dnatentry:Dnatentry example "dnat_entry_id"
    

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

    Package Details

    Repository
    volcenginecc volcengine/pulumi-volcenginecc
    License
    MPL-2.0
    Notes
    This Pulumi package is based on the volcenginecc Terraform Provider.
    volcenginecc logo
    Viewing docs for volcenginecc v0.0.32
    published on Thursday, Apr 23, 2026 by Volcengine
      Try Pulumi Cloud free. Your team will thank you.