1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. vpc
  5. ForwardEntry
Viewing docs for Alibaba Cloud v3.98.0
published on Saturday, Apr 4, 2026 by Pulumi
alicloud logo
Viewing docs for Alibaba Cloud v3.98.0
published on Saturday, Apr 4, 2026 by Pulumi

    Provides a Nat Gateway Forward Entry resource.

    DNAT route table entry.

    For information about Nat Gateway Forward Entry and how to use it, see What is Forward Entry.

    NOTE: Available since v1.40.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = alicloud.getZones({
        availableResourceCreation: "VSwitch",
    });
    const defaultNetwork = new alicloud.vpc.Network("default", {
        vpcName: name,
        cidrBlock: "172.16.0.0/12",
    });
    const defaultSwitch = new alicloud.vpc.Switch("default", {
        vpcId: defaultNetwork.id,
        cidrBlock: "172.16.0.0/21",
        zoneId: _default.then(_default => _default.zones?.[0]?.id),
        vswitchName: name,
    });
    const defaultNatGateway = new alicloud.vpc.NatGateway("default", {
        vpcId: defaultNetwork.id,
        natGatewayName: name,
        natType: "Enhanced",
        vswitchId: defaultSwitch.id,
        networkType: "intranet",
    });
    const defaultNatIp = new alicloud.vpc.NatIp("default", {
        natIp: "172.16.0.66",
        natIpName: name,
        natGatewayId: defaultNatGateway.id,
        natIpCidr: defaultSwitch.cidrBlock,
    });
    const defaultForwardEntry = new alicloud.vpc.ForwardEntry("default", {
        forwardTableId: defaultNatGateway.forwardTableIds,
        externalIp: defaultNatIp.natIp,
        externalPort: "80",
        ipProtocol: "tcp",
        internalIp: "172.16.0.115",
        internalPort: "8080",
        forwardEntryName: name,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.get_zones(available_resource_creation="VSwitch")
    default_network = alicloud.vpc.Network("default",
        vpc_name=name,
        cidr_block="172.16.0.0/12")
    default_switch = alicloud.vpc.Switch("default",
        vpc_id=default_network.id,
        cidr_block="172.16.0.0/21",
        zone_id=default.zones[0].id,
        vswitch_name=name)
    default_nat_gateway = alicloud.vpc.NatGateway("default",
        vpc_id=default_network.id,
        nat_gateway_name=name,
        nat_type="Enhanced",
        vswitch_id=default_switch.id,
        network_type="intranet")
    default_nat_ip = alicloud.vpc.NatIp("default",
        nat_ip="172.16.0.66",
        nat_ip_name=name,
        nat_gateway_id=default_nat_gateway.id,
        nat_ip_cidr=default_switch.cidr_block)
    default_forward_entry = alicloud.vpc.ForwardEntry("default",
        forward_table_id=default_nat_gateway.forward_table_ids,
        external_ip=default_nat_ip.nat_ip,
        external_port="80",
        ip_protocol="tcp",
        internal_ip="172.16.0.115",
        internal_port="8080",
        forward_entry_name=name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"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, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(pulumi.String(name)),
    			CidrBlock: pulumi.String("172.16.0.0/12"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
    			VpcId:       defaultNetwork.ID(),
    			CidrBlock:   pulumi.String("172.16.0.0/21"),
    			ZoneId:      pulumi.String(pulumi.String(_default.Zones[0].Id)),
    			VswitchName: pulumi.String(pulumi.String(name)),
    		})
    		if err != nil {
    			return err
    		}
    		defaultNatGateway, err := vpc.NewNatGateway(ctx, "default", &vpc.NatGatewayArgs{
    			VpcId:          defaultNetwork.ID(),
    			NatGatewayName: pulumi.String(pulumi.String(name)),
    			NatType:        pulumi.String("Enhanced"),
    			VswitchId:      defaultSwitch.ID(),
    			NetworkType:    pulumi.String("intranet"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultNatIp, err := vpc.NewNatIp(ctx, "default", &vpc.NatIpArgs{
    			NatIp:        pulumi.String("172.16.0.66"),
    			NatIpName:    pulumi.String(pulumi.String(name)),
    			NatGatewayId: defaultNatGateway.ID(),
    			NatIpCidr:    defaultSwitch.CidrBlock,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewForwardEntry(ctx, "default", &vpc.ForwardEntryArgs{
    			ForwardTableId:   defaultNatGateway.ForwardTableIds,
    			ExternalIp:       defaultNatIp.NatIp,
    			ExternalPort:     pulumi.String("80"),
    			IpProtocol:       pulumi.String("tcp"),
    			InternalIp:       pulumi.String("172.16.0.115"),
    			InternalPort:     pulumi.String("8080"),
    			ForwardEntryName: pulumi.String(pulumi.String(name)),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.GetZones.Invoke(new()
        {
            AvailableResourceCreation = "VSwitch",
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("default", new()
        {
            VpcName = name,
            CidrBlock = "172.16.0.0/12",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
        {
            VpcId = defaultNetwork.Id,
            CidrBlock = "172.16.0.0/21",
            ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
            VswitchName = name,
        });
    
        var defaultNatGateway = new AliCloud.Vpc.NatGateway("default", new()
        {
            VpcId = defaultNetwork.Id,
            NatGatewayName = name,
            NatType = "Enhanced",
            VswitchId = defaultSwitch.Id,
            NetworkType = "intranet",
        });
    
        var defaultNatIp = new AliCloud.Vpc.NatIp("default", new()
        {
            NatIpAddress = "172.16.0.66",
            NatIpName = name,
            NatGatewayId = defaultNatGateway.Id,
            NatIpCidr = defaultSwitch.CidrBlock,
        });
    
        var defaultForwardEntry = new AliCloud.Vpc.ForwardEntry("default", new()
        {
            ForwardTableId = defaultNatGateway.ForwardTableIds,
            ExternalIp = defaultNatIp.NatIpAddress,
            ExternalPort = "80",
            IpProtocol = "tcp",
            InternalIp = "172.16.0.115",
            InternalPort = "8080",
            ForwardEntryName = name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetZonesArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.vpc.NatGateway;
    import com.pulumi.alicloud.vpc.NatGatewayArgs;
    import com.pulumi.alicloud.vpc.NatIp;
    import com.pulumi.alicloud.vpc.NatIpArgs;
    import com.pulumi.alicloud.vpc.ForwardEntry;
    import com.pulumi.alicloud.vpc.ForwardEntryArgs;
    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 name = config.get("name").orElse("terraform-example");
            final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableResourceCreation("VSwitch")
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
                .vpcName(name)
                .cidrBlock("172.16.0.0/12")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
                .vpcId(defaultNetwork.id())
                .cidrBlock("172.16.0.0/21")
                .zoneId(default_.zones()[0].id())
                .vswitchName(name)
                .build());
    
            var defaultNatGateway = new NatGateway("defaultNatGateway", NatGatewayArgs.builder()
                .vpcId(defaultNetwork.id())
                .natGatewayName(name)
                .natType("Enhanced")
                .vswitchId(defaultSwitch.id())
                .networkType("intranet")
                .build());
    
            var defaultNatIp = new NatIp("defaultNatIp", NatIpArgs.builder()
                .natIp("172.16.0.66")
                .natIpName(name)
                .natGatewayId(defaultNatGateway.id())
                .natIpCidr(defaultSwitch.cidrBlock())
                .build());
    
            var defaultForwardEntry = new ForwardEntry("defaultForwardEntry", ForwardEntryArgs.builder()
                .forwardTableId(defaultNatGateway.forwardTableIds())
                .externalIp(defaultNatIp.natIp())
                .externalPort("80")
                .ipProtocol("tcp")
                .internalIp("172.16.0.115")
                .internalPort("8080")
                .forwardEntryName(name)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultNetwork:
        type: alicloud:vpc:Network
        name: default
        properties:
          vpcName: ${name}
          cidrBlock: 172.16.0.0/12
      defaultSwitch:
        type: alicloud:vpc:Switch
        name: default
        properties:
          vpcId: ${defaultNetwork.id}
          cidrBlock: 172.16.0.0/21
          zoneId: ${default.zones[0].id}
          vswitchName: ${name}
      defaultNatGateway:
        type: alicloud:vpc:NatGateway
        name: default
        properties:
          vpcId: ${defaultNetwork.id}
          natGatewayName: ${name}
          natType: Enhanced
          vswitchId: ${defaultSwitch.id}
          networkType: intranet
      defaultNatIp:
        type: alicloud:vpc:NatIp
        name: default
        properties:
          natIp: 172.16.0.66
          natIpName: ${name}
          natGatewayId: ${defaultNatGateway.id}
          natIpCidr: ${defaultSwitch.cidrBlock}
      defaultForwardEntry:
        type: alicloud:vpc:ForwardEntry
        name: default
        properties:
          forwardTableId: ${defaultNatGateway.forwardTableIds}
          externalIp: ${defaultNatIp.natIp}
          externalPort: '80'
          ipProtocol: tcp
          internalIp: 172.16.0.115
          internalPort: '8080'
          forwardEntryName: ${name}
    variables:
      default:
        fn::invoke:
          function: alicloud:getZones
          arguments:
            availableResourceCreation: VSwitch
    

    📚 Need more examples? VIEW MORE EXAMPLES

    Create ForwardEntry Resource

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

    Constructor syntax

    new ForwardEntry(name: string, args: ForwardEntryArgs, opts?: CustomResourceOptions);
    @overload
    def ForwardEntry(resource_name: str,
                     args: ForwardEntryArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def ForwardEntry(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     external_ip: Optional[str] = None,
                     external_port: Optional[str] = None,
                     forward_table_id: Optional[str] = None,
                     internal_ip: Optional[str] = None,
                     internal_port: Optional[str] = None,
                     ip_protocol: Optional[str] = None,
                     forward_entry_name: Optional[str] = None,
                     name: Optional[str] = None,
                     port_break: Optional[bool] = None)
    func NewForwardEntry(ctx *Context, name string, args ForwardEntryArgs, opts ...ResourceOption) (*ForwardEntry, error)
    public ForwardEntry(string name, ForwardEntryArgs args, CustomResourceOptions? opts = null)
    public ForwardEntry(String name, ForwardEntryArgs args)
    public ForwardEntry(String name, ForwardEntryArgs args, CustomResourceOptions options)
    
    type: alicloud:vpc:ForwardEntry
    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 ForwardEntryArgs
    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 ForwardEntryArgs
    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 ForwardEntryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ForwardEntryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ForwardEntryArgs
    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 forwardEntryResource = new AliCloud.Vpc.ForwardEntry("forwardEntryResource", new()
    {
        ExternalIp = "string",
        ExternalPort = "string",
        ForwardTableId = "string",
        InternalIp = "string",
        InternalPort = "string",
        IpProtocol = "string",
        ForwardEntryName = "string",
        PortBreak = false,
    });
    
    example, err := vpc.NewForwardEntry(ctx, "forwardEntryResource", &vpc.ForwardEntryArgs{
    	ExternalIp:       pulumi.String("string"),
    	ExternalPort:     pulumi.String("string"),
    	ForwardTableId:   pulumi.String("string"),
    	InternalIp:       pulumi.String("string"),
    	InternalPort:     pulumi.String("string"),
    	IpProtocol:       pulumi.String("string"),
    	ForwardEntryName: pulumi.String("string"),
    	PortBreak:        pulumi.Bool(false),
    })
    
    var forwardEntryResource = new ForwardEntry("forwardEntryResource", ForwardEntryArgs.builder()
        .externalIp("string")
        .externalPort("string")
        .forwardTableId("string")
        .internalIp("string")
        .internalPort("string")
        .ipProtocol("string")
        .forwardEntryName("string")
        .portBreak(false)
        .build());
    
    forward_entry_resource = alicloud.vpc.ForwardEntry("forwardEntryResource",
        external_ip="string",
        external_port="string",
        forward_table_id="string",
        internal_ip="string",
        internal_port="string",
        ip_protocol="string",
        forward_entry_name="string",
        port_break=False)
    
    const forwardEntryResource = new alicloud.vpc.ForwardEntry("forwardEntryResource", {
        externalIp: "string",
        externalPort: "string",
        forwardTableId: "string",
        internalIp: "string",
        internalPort: "string",
        ipProtocol: "string",
        forwardEntryName: "string",
        portBreak: false,
    });
    
    type: alicloud:vpc:ForwardEntry
    properties:
        externalIp: string
        externalPort: string
        forwardEntryName: string
        forwardTableId: string
        internalIp: string
        internalPort: string
        ipProtocol: string
        portBreak: false
    

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

    ExternalIp string
    When querying DNAT entries of an Internet NAT gateway, this parameter indicates the Elastic IP address used in the DNAT entry to provide public network access.

    • When querying DNAT entries of a VPC NAT gateway, this parameter indicates the NAT IP address used for access from external networks.
    ExternalPort string
    The external port or port range that is used for port forwarding when you query DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.

    • If you want to query a port range, separate the first port and last port with a forward slash (/), such as 10/20.
    • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified by these parameters must be the same. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
    ForwardTableId string
    The ID of the DNAT table to which the DNAT entry belongs.
    InternalIp string
    The private IP address.

    • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you query DNAT entries of Internet NAT gateways.
    • The private IP address that uses DNAT entries when you query DNAT entries of VPC NAT gateways.
    InternalPort string
    When you configure a DNAT entry for an Internet NAT gateway, this parameter specifies the internal port or port range that requires port forwarding. Valid values: 1 to 65535.

    • When you configure a DNAT entry for a VPC NAT gateway, this parameter specifies the destination ECS instance port to be mapped. Valid values: 1 to 65535.
    IpProtocol string
    The protocol type. Valid values:
    ForwardEntryName string
    The name of the DNAT entry.
    Name string
    Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    Deprecated: Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    PortBreak bool
    Specifies whether to enable port break. Valid values:
    ExternalIp string
    When querying DNAT entries of an Internet NAT gateway, this parameter indicates the Elastic IP address used in the DNAT entry to provide public network access.

    • When querying DNAT entries of a VPC NAT gateway, this parameter indicates the NAT IP address used for access from external networks.
    ExternalPort string
    The external port or port range that is used for port forwarding when you query DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.

    • If you want to query a port range, separate the first port and last port with a forward slash (/), such as 10/20.
    • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified by these parameters must be the same. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
    ForwardTableId string
    The ID of the DNAT table to which the DNAT entry belongs.
    InternalIp string
    The private IP address.

    • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you query DNAT entries of Internet NAT gateways.
    • The private IP address that uses DNAT entries when you query DNAT entries of VPC NAT gateways.
    InternalPort string
    When you configure a DNAT entry for an Internet NAT gateway, this parameter specifies the internal port or port range that requires port forwarding. Valid values: 1 to 65535.

    • When you configure a DNAT entry for a VPC NAT gateway, this parameter specifies the destination ECS instance port to be mapped. Valid values: 1 to 65535.
    IpProtocol string
    The protocol type. Valid values:
    ForwardEntryName string
    The name of the DNAT entry.
    Name string
    Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    Deprecated: Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    PortBreak bool
    Specifies whether to enable port break. Valid values:
    externalIp String
    When querying DNAT entries of an Internet NAT gateway, this parameter indicates the Elastic IP address used in the DNAT entry to provide public network access.

    • When querying DNAT entries of a VPC NAT gateway, this parameter indicates the NAT IP address used for access from external networks.
    externalPort String
    The external port or port range that is used for port forwarding when you query DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.

    • If you want to query a port range, separate the first port and last port with a forward slash (/), such as 10/20.
    • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified by these parameters must be the same. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
    forwardTableId String
    The ID of the DNAT table to which the DNAT entry belongs.
    internalIp String
    The private IP address.

    • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you query DNAT entries of Internet NAT gateways.
    • The private IP address that uses DNAT entries when you query DNAT entries of VPC NAT gateways.
    internalPort String
    When you configure a DNAT entry for an Internet NAT gateway, this parameter specifies the internal port or port range that requires port forwarding. Valid values: 1 to 65535.

    • When you configure a DNAT entry for a VPC NAT gateway, this parameter specifies the destination ECS instance port to be mapped. Valid values: 1 to 65535.
    ipProtocol String
    The protocol type. Valid values:
    forwardEntryName String
    The name of the DNAT entry.
    name String
    Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    Deprecated: Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    portBreak Boolean
    Specifies whether to enable port break. Valid values:
    externalIp string
    When querying DNAT entries of an Internet NAT gateway, this parameter indicates the Elastic IP address used in the DNAT entry to provide public network access.

    • When querying DNAT entries of a VPC NAT gateway, this parameter indicates the NAT IP address used for access from external networks.
    externalPort string
    The external port or port range that is used for port forwarding when you query DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.

    • If you want to query a port range, separate the first port and last port with a forward slash (/), such as 10/20.
    • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified by these parameters must be the same. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
    forwardTableId string
    The ID of the DNAT table to which the DNAT entry belongs.
    internalIp string
    The private IP address.

    • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you query DNAT entries of Internet NAT gateways.
    • The private IP address that uses DNAT entries when you query DNAT entries of VPC NAT gateways.
    internalPort string
    When you configure a DNAT entry for an Internet NAT gateway, this parameter specifies the internal port or port range that requires port forwarding. Valid values: 1 to 65535.

    • When you configure a DNAT entry for a VPC NAT gateway, this parameter specifies the destination ECS instance port to be mapped. Valid values: 1 to 65535.
    ipProtocol string
    The protocol type. Valid values:
    forwardEntryName string
    The name of the DNAT entry.
    name string
    Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    Deprecated: Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    portBreak boolean
    Specifies whether to enable port break. Valid values:
    external_ip str
    When querying DNAT entries of an Internet NAT gateway, this parameter indicates the Elastic IP address used in the DNAT entry to provide public network access.

    • When querying DNAT entries of a VPC NAT gateway, this parameter indicates the NAT IP address used for access from external networks.
    external_port str
    The external port or port range that is used for port forwarding when you query DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.

    • If you want to query a port range, separate the first port and last port with a forward slash (/), such as 10/20.
    • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified by these parameters must be the same. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
    forward_table_id str
    The ID of the DNAT table to which the DNAT entry belongs.
    internal_ip str
    The private IP address.

    • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you query DNAT entries of Internet NAT gateways.
    • The private IP address that uses DNAT entries when you query DNAT entries of VPC NAT gateways.
    internal_port str
    When you configure a DNAT entry for an Internet NAT gateway, this parameter specifies the internal port or port range that requires port forwarding. Valid values: 1 to 65535.

    • When you configure a DNAT entry for a VPC NAT gateway, this parameter specifies the destination ECS instance port to be mapped. Valid values: 1 to 65535.
    ip_protocol str
    The protocol type. Valid values:
    forward_entry_name str
    The name of the DNAT entry.
    name str
    Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    Deprecated: Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    port_break bool
    Specifies whether to enable port break. Valid values:
    externalIp String
    When querying DNAT entries of an Internet NAT gateway, this parameter indicates the Elastic IP address used in the DNAT entry to provide public network access.

    • When querying DNAT entries of a VPC NAT gateway, this parameter indicates the NAT IP address used for access from external networks.
    externalPort String
    The external port or port range that is used for port forwarding when you query DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.

    • If you want to query a port range, separate the first port and last port with a forward slash (/), such as 10/20.
    • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified by these parameters must be the same. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
    forwardTableId String
    The ID of the DNAT table to which the DNAT entry belongs.
    internalIp String
    The private IP address.

    • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you query DNAT entries of Internet NAT gateways.
    • The private IP address that uses DNAT entries when you query DNAT entries of VPC NAT gateways.
    internalPort String
    When you configure a DNAT entry for an Internet NAT gateway, this parameter specifies the internal port or port range that requires port forwarding. Valid values: 1 to 65535.

    • When you configure a DNAT entry for a VPC NAT gateway, this parameter specifies the destination ECS instance port to be mapped. Valid values: 1 to 65535.
    ipProtocol String
    The protocol type. Valid values:
    forwardEntryName String
    The name of the DNAT entry.
    name String
    Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    Deprecated: Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    portBreak Boolean
    Specifies whether to enable port break. Valid values:

    Outputs

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

    ForwardEntryId string
    (Available since v1.43.0) The id of the forward entry on the server.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    (Available since v1.119.1) The status of forward entry.
    ForwardEntryId string
    (Available since v1.43.0) The id of the forward entry on the server.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    (Available since v1.119.1) The status of forward entry.
    forwardEntryId String
    (Available since v1.43.0) The id of the forward entry on the server.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    (Available since v1.119.1) The status of forward entry.
    forwardEntryId string
    (Available since v1.43.0) The id of the forward entry on the server.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    (Available since v1.119.1) The status of forward entry.
    forward_entry_id str
    (Available since v1.43.0) The id of the forward entry on the server.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    (Available since v1.119.1) The status of forward entry.
    forwardEntryId String
    (Available since v1.43.0) The id of the forward entry on the server.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    (Available since v1.119.1) The status of forward entry.

    Look up Existing ForwardEntry Resource

    Get an existing ForwardEntry 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?: ForwardEntryState, opts?: CustomResourceOptions): ForwardEntry
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            external_ip: Optional[str] = None,
            external_port: Optional[str] = None,
            forward_entry_id: Optional[str] = None,
            forward_entry_name: Optional[str] = None,
            forward_table_id: Optional[str] = None,
            internal_ip: Optional[str] = None,
            internal_port: Optional[str] = None,
            ip_protocol: Optional[str] = None,
            name: Optional[str] = None,
            port_break: Optional[bool] = None,
            status: Optional[str] = None) -> ForwardEntry
    func GetForwardEntry(ctx *Context, name string, id IDInput, state *ForwardEntryState, opts ...ResourceOption) (*ForwardEntry, error)
    public static ForwardEntry Get(string name, Input<string> id, ForwardEntryState? state, CustomResourceOptions? opts = null)
    public static ForwardEntry get(String name, Output<String> id, ForwardEntryState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:vpc:ForwardEntry    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:
    ExternalIp string
    When querying DNAT entries of an Internet NAT gateway, this parameter indicates the Elastic IP address used in the DNAT entry to provide public network access.

    • When querying DNAT entries of a VPC NAT gateway, this parameter indicates the NAT IP address used for access from external networks.
    ExternalPort string
    The external port or port range that is used for port forwarding when you query DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.

    • If you want to query a port range, separate the first port and last port with a forward slash (/), such as 10/20.
    • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified by these parameters must be the same. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
    ForwardEntryId string
    (Available since v1.43.0) The id of the forward entry on the server.
    ForwardEntryName string
    The name of the DNAT entry.
    ForwardTableId string
    The ID of the DNAT table to which the DNAT entry belongs.
    InternalIp string
    The private IP address.

    • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you query DNAT entries of Internet NAT gateways.
    • The private IP address that uses DNAT entries when you query DNAT entries of VPC NAT gateways.
    InternalPort string
    When you configure a DNAT entry for an Internet NAT gateway, this parameter specifies the internal port or port range that requires port forwarding. Valid values: 1 to 65535.

    • When you configure a DNAT entry for a VPC NAT gateway, this parameter specifies the destination ECS instance port to be mapped. Valid values: 1 to 65535.
    IpProtocol string
    The protocol type. Valid values:
    Name string
    Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    Deprecated: Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    PortBreak bool
    Specifies whether to enable port break. Valid values:
    Status string
    (Available since v1.119.1) The status of forward entry.
    ExternalIp string
    When querying DNAT entries of an Internet NAT gateway, this parameter indicates the Elastic IP address used in the DNAT entry to provide public network access.

    • When querying DNAT entries of a VPC NAT gateway, this parameter indicates the NAT IP address used for access from external networks.
    ExternalPort string
    The external port or port range that is used for port forwarding when you query DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.

    • If you want to query a port range, separate the first port and last port with a forward slash (/), such as 10/20.
    • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified by these parameters must be the same. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
    ForwardEntryId string
    (Available since v1.43.0) The id of the forward entry on the server.
    ForwardEntryName string
    The name of the DNAT entry.
    ForwardTableId string
    The ID of the DNAT table to which the DNAT entry belongs.
    InternalIp string
    The private IP address.

    • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you query DNAT entries of Internet NAT gateways.
    • The private IP address that uses DNAT entries when you query DNAT entries of VPC NAT gateways.
    InternalPort string
    When you configure a DNAT entry for an Internet NAT gateway, this parameter specifies the internal port or port range that requires port forwarding. Valid values: 1 to 65535.

    • When you configure a DNAT entry for a VPC NAT gateway, this parameter specifies the destination ECS instance port to be mapped. Valid values: 1 to 65535.
    IpProtocol string
    The protocol type. Valid values:
    Name string
    Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    Deprecated: Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    PortBreak bool
    Specifies whether to enable port break. Valid values:
    Status string
    (Available since v1.119.1) The status of forward entry.
    externalIp String
    When querying DNAT entries of an Internet NAT gateway, this parameter indicates the Elastic IP address used in the DNAT entry to provide public network access.

    • When querying DNAT entries of a VPC NAT gateway, this parameter indicates the NAT IP address used for access from external networks.
    externalPort String
    The external port or port range that is used for port forwarding when you query DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.

    • If you want to query a port range, separate the first port and last port with a forward slash (/), such as 10/20.
    • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified by these parameters must be the same. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
    forwardEntryId String
    (Available since v1.43.0) The id of the forward entry on the server.
    forwardEntryName String
    The name of the DNAT entry.
    forwardTableId String
    The ID of the DNAT table to which the DNAT entry belongs.
    internalIp String
    The private IP address.

    • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you query DNAT entries of Internet NAT gateways.
    • The private IP address that uses DNAT entries when you query DNAT entries of VPC NAT gateways.
    internalPort String
    When you configure a DNAT entry for an Internet NAT gateway, this parameter specifies the internal port or port range that requires port forwarding. Valid values: 1 to 65535.

    • When you configure a DNAT entry for a VPC NAT gateway, this parameter specifies the destination ECS instance port to be mapped. Valid values: 1 to 65535.
    ipProtocol String
    The protocol type. Valid values:
    name String
    Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    Deprecated: Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    portBreak Boolean
    Specifies whether to enable port break. Valid values:
    status String
    (Available since v1.119.1) The status of forward entry.
    externalIp string
    When querying DNAT entries of an Internet NAT gateway, this parameter indicates the Elastic IP address used in the DNAT entry to provide public network access.

    • When querying DNAT entries of a VPC NAT gateway, this parameter indicates the NAT IP address used for access from external networks.
    externalPort string
    The external port or port range that is used for port forwarding when you query DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.

    • If you want to query a port range, separate the first port and last port with a forward slash (/), such as 10/20.
    • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified by these parameters must be the same. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
    forwardEntryId string
    (Available since v1.43.0) The id of the forward entry on the server.
    forwardEntryName string
    The name of the DNAT entry.
    forwardTableId string
    The ID of the DNAT table to which the DNAT entry belongs.
    internalIp string
    The private IP address.

    • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you query DNAT entries of Internet NAT gateways.
    • The private IP address that uses DNAT entries when you query DNAT entries of VPC NAT gateways.
    internalPort string
    When you configure a DNAT entry for an Internet NAT gateway, this parameter specifies the internal port or port range that requires port forwarding. Valid values: 1 to 65535.

    • When you configure a DNAT entry for a VPC NAT gateway, this parameter specifies the destination ECS instance port to be mapped. Valid values: 1 to 65535.
    ipProtocol string
    The protocol type. Valid values:
    name string
    Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    Deprecated: Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    portBreak boolean
    Specifies whether to enable port break. Valid values:
    status string
    (Available since v1.119.1) The status of forward entry.
    external_ip str
    When querying DNAT entries of an Internet NAT gateway, this parameter indicates the Elastic IP address used in the DNAT entry to provide public network access.

    • When querying DNAT entries of a VPC NAT gateway, this parameter indicates the NAT IP address used for access from external networks.
    external_port str
    The external port or port range that is used for port forwarding when you query DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.

    • If you want to query a port range, separate the first port and last port with a forward slash (/), such as 10/20.
    • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified by these parameters must be the same. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
    forward_entry_id str
    (Available since v1.43.0) The id of the forward entry on the server.
    forward_entry_name str
    The name of the DNAT entry.
    forward_table_id str
    The ID of the DNAT table to which the DNAT entry belongs.
    internal_ip str
    The private IP address.

    • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you query DNAT entries of Internet NAT gateways.
    • The private IP address that uses DNAT entries when you query DNAT entries of VPC NAT gateways.
    internal_port str
    When you configure a DNAT entry for an Internet NAT gateway, this parameter specifies the internal port or port range that requires port forwarding. Valid values: 1 to 65535.

    • When you configure a DNAT entry for a VPC NAT gateway, this parameter specifies the destination ECS instance port to be mapped. Valid values: 1 to 65535.
    ip_protocol str
    The protocol type. Valid values:
    name str
    Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    Deprecated: Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    port_break bool
    Specifies whether to enable port break. Valid values:
    status str
    (Available since v1.119.1) The status of forward entry.
    externalIp String
    When querying DNAT entries of an Internet NAT gateway, this parameter indicates the Elastic IP address used in the DNAT entry to provide public network access.

    • When querying DNAT entries of a VPC NAT gateway, this parameter indicates the NAT IP address used for access from external networks.
    externalPort String
    The external port or port range that is used for port forwarding when you query DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.

    • If you want to query a port range, separate the first port and last port with a forward slash (/), such as 10/20.
    • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified by these parameters must be the same. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
    forwardEntryId String
    (Available since v1.43.0) The id of the forward entry on the server.
    forwardEntryName String
    The name of the DNAT entry.
    forwardTableId String
    The ID of the DNAT table to which the DNAT entry belongs.
    internalIp String
    The private IP address.

    • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you query DNAT entries of Internet NAT gateways.
    • The private IP address that uses DNAT entries when you query DNAT entries of VPC NAT gateways.
    internalPort String
    When you configure a DNAT entry for an Internet NAT gateway, this parameter specifies the internal port or port range that requires port forwarding. Valid values: 1 to 65535.

    • When you configure a DNAT entry for a VPC NAT gateway, this parameter specifies the destination ECS instance port to be mapped. Valid values: 1 to 65535.
    ipProtocol String
    The protocol type. Valid values:
    name String
    Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    Deprecated: Field name has been deprecated from provider version 1.119.1. New field forwardEntryName instead.

    portBreak Boolean
    Specifies whether to enable port break. Valid values:
    status String
    (Available since v1.119.1) The status of forward entry.

    Import

    Nat Gateway Forward Entry can be imported using the id, e.g.

    $ pulumi import alicloud:vpc/forwardEntry:ForwardEntry example <forward_table_id>:<forward_entry_id>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Viewing docs for Alibaba Cloud v3.98.0
    published on Saturday, Apr 4, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.