alicloud.rocketmq.DnatEntry
Explore with Pulumi AI
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 since v1.63.0.
NOTE: Only the following regions suppor. [
cn-shanghai
,cn-shanghai-finance-1
,cn-hongkong
,ap-southeast-1
,ap-southeast-3
,ap-southeast-5
,ap-northeast-1
,eu-central-1
]
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const sagId = config.get("sagId") || "sag-9bifkfaz***";
const _default = new alicloud.rocketmq.DnatEntry("default", {
sagId: sagId,
type: "Intranet",
ipProtocol: "any",
externalIp: "172.32.0.2",
externalPort: "any",
internalIp: "172.16.0.4",
internalPort: "any",
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
sag_id = config.get("sagId")
if sag_id is None:
sag_id = "sag-9bifkfaz***"
default = alicloud.rocketmq.DnatEntry("default",
sag_id=sag_id,
type="Intranet",
ip_protocol="any",
external_ip="172.32.0.2",
external_port="any",
internal_ip="172.16.0.4",
internal_port="any")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/rocketmq"
"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, "")
sagId := "sag-9bifkfaz***"
if param := cfg.Get("sagId"); param != "" {
sagId = param
}
_, err := rocketmq.NewDnatEntry(ctx, "default", &rocketmq.DnatEntryArgs{
SagId: pulumi.String(sagId),
Type: pulumi.String("Intranet"),
IpProtocol: pulumi.String("any"),
ExternalIp: pulumi.String("172.32.0.2"),
ExternalPort: pulumi.String("any"),
InternalIp: pulumi.String("172.16.0.4"),
InternalPort: pulumi.String("any"),
})
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 sagId = config.Get("sagId") ?? "sag-9bifkfaz***";
var @default = new AliCloud.RocketMQ.DnatEntry("default", new()
{
SagId = sagId,
Type = "Intranet",
IpProtocol = "any",
ExternalIp = "172.32.0.2",
ExternalPort = "any",
InternalIp = "172.16.0.4",
InternalPort = "any",
});
});
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) {
final var config = ctx.config();
final var sagId = config.get("sagId").orElse("sag-9bifkfaz***");
var default_ = new DnatEntry("default", DnatEntryArgs.builder()
.sagId(sagId)
.type("Intranet")
.ipProtocol("any")
.externalIp("172.32.0.2")
.externalPort("any")
.internalIp("172.16.0.4")
.internalPort("any")
.build());
}
}
configuration:
sagId:
type: string
default: sag-9bifkfaz***
resources:
default:
type: alicloud:rocketmq:DnatEntry
properties:
sagId: ${sagId}
type: Intranet
ipProtocol: any
externalIp: 172.32.0.2
externalPort: any
internalIp: 172.16.0.4
internalPort: any
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_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,
external_ip: 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: alicloud:rocketmq: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 AliCloud.RocketMQ.DnatEntry("dnatEntryResource", new()
{
ExternalPort = "string",
InternalIp = "string",
InternalPort = "string",
IpProtocol = "string",
SagId = "string",
Type = "string",
ExternalIp = "string",
});
example, err := rocketmq.NewDnatEntry(ctx, "dnatEntryResource", &rocketmq.DnatEntryArgs{
ExternalPort: pulumi.String("string"),
InternalIp: pulumi.String("string"),
InternalPort: pulumi.String("string"),
IpProtocol: pulumi.String("string"),
SagId: pulumi.String("string"),
Type: pulumi.String("string"),
ExternalIp: pulumi.String("string"),
})
var dnatEntryResource = new DnatEntry("dnatEntryResource", DnatEntryArgs.builder()
.externalPort("string")
.internalIp("string")
.internalPort("string")
.ipProtocol("string")
.sagId("string")
.type("string")
.externalIp("string")
.build());
dnat_entry_resource = alicloud.rocketmq.DnatEntry("dnatEntryResource",
external_port="string",
internal_ip="string",
internal_port="string",
ip_protocol="string",
sag_id="string",
type="string",
external_ip="string")
const dnatEntryResource = new alicloud.rocketmq.DnatEntry("dnatEntryResource", {
externalPort: "string",
internalIp: "string",
internalPort: "string",
ipProtocol: "string",
sagId: "string",
type: "string",
externalIp: "string",
});
type: alicloud:rocketmq:DnatEntry
properties:
externalIp: string
externalPort: string
internalIp: string
internalPort: string
ipProtocol: string
sagId: string
type: 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:
- External
Port string - The public port.Value range: 1 to 65535 or "any".
- Internal
Ip string - The destination private IP address.
- Internal
Port string - The destination private port.Value range: 1 to 65535 or "any".
- Ip
Protocol 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.
- Sag
Id 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 string - The external public IP address.when "type" is "Internet",automatically identify the external ip.
- External
Port string - The public port.Value range: 1 to 65535 or "any".
- Internal
Ip string - The destination private IP address.
- Internal
Port string - The destination private port.Value range: 1 to 65535 or "any".
- Ip
Protocol 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.
- Sag
Id 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 string - The external public IP address.when "type" is "Internet",automatically identify the external ip.
- external
Port String - The public port.Value range: 1 to 65535 or "any".
- internal
Ip String - The destination private IP address.
- internal
Port String - The destination private port.Value range: 1 to 65535 or "any".
- ip
Protocol 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.
- sag
Id 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 String - The external public IP address.when "type" is "Internet",automatically identify the external ip.
- external
Port string - The public port.Value range: 1 to 65535 or "any".
- internal
Ip string - The destination private IP address.
- internal
Port string - The destination private port.Value range: 1 to 65535 or "any".
- ip
Protocol 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.
- sag
Id 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 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.
- external
Port String - The public port.Value range: 1 to 65535 or "any".
- internal
Ip String - The destination private IP address.
- internal
Port String - The destination private port.Value range: 1 to 65535 or "any".
- ip
Protocol 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.
- sag
Id 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 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.
- External
Ip string - The external public IP address.when "type" is "Internet",automatically identify the external ip.
- External
Port string - The public port.Value range: 1 to 65535 or "any".
- Internal
Ip string - The destination private IP address.
- Internal
Port string - The destination private port.Value range: 1 to 65535 or "any".
- Ip
Protocol 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.
- Sag
Id 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 string - The external public IP address.when "type" is "Internet",automatically identify the external ip.
- External
Port string - The public port.Value range: 1 to 65535 or "any".
- Internal
Ip string - The destination private IP address.
- Internal
Port string - The destination private port.Value range: 1 to 65535 or "any".
- Ip
Protocol 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.
- Sag
Id 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 String - The external public IP address.when "type" is "Internet",automatically identify the external ip.
- external
Port String - The public port.Value range: 1 to 65535 or "any".
- internal
Ip String - The destination private IP address.
- internal
Port String - The destination private port.Value range: 1 to 65535 or "any".
- ip
Protocol 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.
- sag
Id 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 string - The external public IP address.when "type" is "Internet",automatically identify the external ip.
- external
Port string - The public port.Value range: 1 to 65535 or "any".
- internal
Ip string - The destination private IP address.
- internal
Port string - The destination private port.Value range: 1 to 65535 or "any".
- ip
Protocol 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.
- sag
Id 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
- external
Ip String - The external public IP address.when "type" is "Internet",automatically identify the external ip.
- external
Port String - The public port.Value range: 1 to 65535 or "any".
- internal
Ip String - The destination private IP address.
- internal
Port String - The destination private port.Value range: 1 to 65535 or "any".
- ip
Protocol 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.
- sag
Id 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
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.