alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.rocketmq.DnatEntry

Provides a Sag DnatEntry resource. This topic describes how to add a DNAT entry to a Smart Access Gateway (SAG) instance to enable the DNAT function. By using the DNAT function, you can forward requests received by public IP addresses to Alibaba Cloud instances according to custom mapping rules.

For information about Sag DnatEntry and how to use it, see What is Sag DnatEntry.

NOTE: Available in 1.63.0+

NOTE: Only the following regions suppor. [cn-shanghai, cn-shanghai-finance-1, cn-hongkong, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-5, ap-northeast-1, eu-central-1]

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var @default = new AliCloud.RocketMQ.DnatEntry("default", new()
    {
        ExternalIp = "1.0.0.2",
        ExternalPort = "1",
        InternalIp = "10.0.0.2",
        InternalPort = "20",
        IpProtocol = "tcp",
        SagId = "sag-3rb1t3iagy3w0zgwy9",
        Type = "Intranet",
    });

});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/rocketmq"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := rocketmq.NewDnatEntry(ctx, "default", &rocketmq.DnatEntryArgs{
			ExternalIp:   pulumi.String("1.0.0.2"),
			ExternalPort: pulumi.String("1"),
			InternalIp:   pulumi.String("10.0.0.2"),
			InternalPort: pulumi.String("20"),
			IpProtocol:   pulumi.String("tcp"),
			SagId:        pulumi.String("sag-3rb1t3iagy3w0zgwy9"),
			Type:         pulumi.String("Intranet"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.rocketmq.DnatEntry;
import com.pulumi.alicloud.rocketmq.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 default_ = new DnatEntry("default", DnatEntryArgs.builder()        
            .externalIp("1.0.0.2")
            .externalPort("1")
            .internalIp("10.0.0.2")
            .internalPort("20")
            .ipProtocol("tcp")
            .sagId("sag-3rb1t3iagy3w0zgwy9")
            .type("Intranet")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.rocketmq.DnatEntry("default",
    external_ip="1.0.0.2",
    external_port="1",
    internal_ip="10.0.0.2",
    internal_port="20",
    ip_protocol="tcp",
    sag_id="sag-3rb1t3iagy3w0zgwy9",
    type="Intranet")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const _default = new alicloud.rocketmq.DnatEntry("default", {
    externalIp: "1.0.0.2",
    externalPort: "1",
    internalIp: "10.0.0.2",
    internalPort: "20",
    ipProtocol: "tcp",
    sagId: "sag-3rb1t3iagy3w0zgwy9",
    type: "Intranet",
});
resources:
  default:
    type: alicloud:rocketmq:DnatEntry
    properties:
      externalIp: 1.0.0.2
      externalPort: '1'
      internalIp: 10.0.0.2
      internalPort: '20'
      ipProtocol: tcp
      sagId: sag-3rb1t3iagy3w0zgwy9
      type: Intranet

Create DnatEntry Resource

new DnatEntry(name: string, args: DnatEntryArgs, opts?: CustomResourceOptions);
@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,
              ip_protocol: Optional[str] = None,
              sag_id: Optional[str] = None,
              type: Optional[str] = None)
@overload
def DnatEntry(resource_name: str,
              args: DnatEntryArgs,
              opts: Optional[ResourceOptions] = 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: alicloud:rocketmq:DnatEntry
properties: # The arguments to resource properties.
options: # 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.
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.

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

The DnatEntry resource accepts the following input properties:

ExternalPort string

The public port.Value range: 1 to 65535 or "any".

InternalIp string

The destination private IP address.

InternalPort string

The destination private port.Value range: 1 to 65535 or "any".

IpProtocol string

The protocol type. Valid values: TCP: Forwards packets of the TCP protocol. UDP: Forwards packets of the UDP protocol. Any: Forwards packets of all protocols.

SagId string

The ID of the SAG instance.

Type string

The DNAT type. Valid values: Intranet: DNAT of private IP addresses. Internet: DNAT of public IP addresses

ExternalIp string

The external public IP address.when "type" is "Internet",automatically identify the external ip.

ExternalPort string

The public port.Value range: 1 to 65535 or "any".

InternalIp string

The destination private IP address.

InternalPort string

The destination private port.Value range: 1 to 65535 or "any".

IpProtocol string

The protocol type. Valid values: TCP: Forwards packets of the TCP protocol. UDP: Forwards packets of the UDP protocol. Any: Forwards packets of all protocols.

SagId string

The ID of the SAG instance.

Type string

The DNAT type. Valid values: Intranet: DNAT of private IP addresses. Internet: DNAT of public IP addresses

ExternalIp string

The external public IP address.when "type" is "Internet",automatically identify the external ip.

externalPort String

The public port.Value range: 1 to 65535 or "any".

internalIp String

The destination private IP address.

internalPort String

The destination private port.Value range: 1 to 65535 or "any".

ipProtocol String

The protocol type. Valid values: TCP: Forwards packets of the TCP protocol. UDP: Forwards packets of the UDP protocol. Any: Forwards packets of all protocols.

sagId String

The ID of the SAG instance.

type String

The DNAT type. Valid values: Intranet: DNAT of private IP addresses. Internet: DNAT of public IP addresses

externalIp String

The external public IP address.when "type" is "Internet",automatically identify the external ip.

externalPort string

The public port.Value range: 1 to 65535 or "any".

internalIp string

The destination private IP address.

internalPort string

The destination private port.Value range: 1 to 65535 or "any".

ipProtocol string

The protocol type. Valid values: TCP: Forwards packets of the TCP protocol. UDP: Forwards packets of the UDP protocol. Any: Forwards packets of all protocols.

sagId string

The ID of the SAG instance.

type string

The DNAT type. Valid values: Intranet: DNAT of private IP addresses. Internet: DNAT of public IP addresses

externalIp string

The external public IP address.when "type" is "Internet",automatically identify the external ip.

external_port str

The public port.Value range: 1 to 65535 or "any".

internal_ip str

The destination private IP address.

internal_port str

The destination private port.Value range: 1 to 65535 or "any".

ip_protocol str

The protocol type. Valid values: TCP: Forwards packets of the TCP protocol. UDP: Forwards packets of the UDP protocol. Any: Forwards packets of all protocols.

sag_id str

The ID of the SAG instance.

type str

The DNAT type. Valid values: Intranet: DNAT of private IP addresses. Internet: DNAT of public IP addresses

external_ip str

The external public IP address.when "type" is "Internet",automatically identify the external ip.

externalPort String

The public port.Value range: 1 to 65535 or "any".

internalIp String

The destination private IP address.

internalPort String

The destination private port.Value range: 1 to 65535 or "any".

ipProtocol String

The protocol type. Valid values: TCP: Forwards packets of the TCP protocol. UDP: Forwards packets of the UDP protocol. Any: Forwards packets of all protocols.

sagId String

The ID of the SAG instance.

type String

The DNAT type. Valid values: Intranet: DNAT of private IP addresses. Internet: DNAT of public IP addresses

externalIp String

The external public IP address.when "type" is "Internet",automatically identify the external ip.

Outputs

All input properties are implicitly available as output properties. Additionally, the DnatEntry 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 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,
        external_ip: Optional[str] = None,
        external_port: Optional[str] = None,
        internal_ip: Optional[str] = None,
        internal_port: Optional[str] = None,
        ip_protocol: Optional[str] = None,
        sag_id: Optional[str] = None,
        type: 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)
Resource lookup is not supported in YAML
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

The external public IP address.when "type" is "Internet",automatically identify the external ip.

ExternalPort string

The public port.Value range: 1 to 65535 or "any".

InternalIp string

The destination private IP address.

InternalPort string

The destination private port.Value range: 1 to 65535 or "any".

IpProtocol string

The protocol type. Valid values: TCP: Forwards packets of the TCP protocol. UDP: Forwards packets of the UDP protocol. Any: Forwards packets of all protocols.

SagId string

The ID of the SAG instance.

Type string

The DNAT type. Valid values: Intranet: DNAT of private IP addresses. Internet: DNAT of public IP addresses

ExternalIp string

The external public IP address.when "type" is "Internet",automatically identify the external ip.

ExternalPort string

The public port.Value range: 1 to 65535 or "any".

InternalIp string

The destination private IP address.

InternalPort string

The destination private port.Value range: 1 to 65535 or "any".

IpProtocol string

The protocol type. Valid values: TCP: Forwards packets of the TCP protocol. UDP: Forwards packets of the UDP protocol. Any: Forwards packets of all protocols.

SagId string

The ID of the SAG instance.

Type string

The DNAT type. Valid values: Intranet: DNAT of private IP addresses. Internet: DNAT of public IP addresses

externalIp String

The external public IP address.when "type" is "Internet",automatically identify the external ip.

externalPort String

The public port.Value range: 1 to 65535 or "any".

internalIp String

The destination private IP address.

internalPort String

The destination private port.Value range: 1 to 65535 or "any".

ipProtocol String

The protocol type. Valid values: TCP: Forwards packets of the TCP protocol. UDP: Forwards packets of the UDP protocol. Any: Forwards packets of all protocols.

sagId String

The ID of the SAG instance.

type String

The DNAT type. Valid values: Intranet: DNAT of private IP addresses. Internet: DNAT of public IP addresses

externalIp string

The external public IP address.when "type" is "Internet",automatically identify the external ip.

externalPort string

The public port.Value range: 1 to 65535 or "any".

internalIp string

The destination private IP address.

internalPort string

The destination private port.Value range: 1 to 65535 or "any".

ipProtocol string

The protocol type. Valid values: TCP: Forwards packets of the TCP protocol. UDP: Forwards packets of the UDP protocol. Any: Forwards packets of all protocols.

sagId string

The ID of the SAG instance.

type string

The DNAT type. Valid values: Intranet: DNAT of private IP addresses. Internet: DNAT of public IP addresses

external_ip str

The external public IP address.when "type" is "Internet",automatically identify the external ip.

external_port str

The public port.Value range: 1 to 65535 or "any".

internal_ip str

The destination private IP address.

internal_port str

The destination private port.Value range: 1 to 65535 or "any".

ip_protocol str

The protocol type. Valid values: TCP: Forwards packets of the TCP protocol. UDP: Forwards packets of the UDP protocol. Any: Forwards packets of all protocols.

sag_id str

The ID of the SAG instance.

type str

The DNAT type. Valid values: Intranet: DNAT of private IP addresses. Internet: DNAT of public IP addresses

externalIp String

The external public IP address.when "type" is "Internet",automatically identify the external ip.

externalPort String

The public port.Value range: 1 to 65535 or "any".

internalIp String

The destination private IP address.

internalPort String

The destination private port.Value range: 1 to 65535 or "any".

ipProtocol String

The protocol type. Valid values: TCP: Forwards packets of the TCP protocol. UDP: Forwards packets of the UDP protocol. Any: Forwards packets of all protocols.

sagId String

The ID of the SAG instance.

type String

The DNAT type. Valid values: Intranet: DNAT of private IP addresses. Internet: DNAT of public IP addresses

Import

The Sag DnatEntry can be imported using the id, e.g.

 $ pulumi import alicloud:rocketmq/dnatEntry:DnatEntry example sag-abc123456:dnat-abc123456

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.