Dnat Entry Args
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.sag.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.sag.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")
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.Sag.DnatEntry("default", new()
{
SagId = sagId,
Type = "Intranet",
IpProtocol = "any",
ExternalIp = "172.32.0.2",
ExternalPort = "any",
InternalIp = "172.16.0.4",
InternalPort = "any",
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/sag"
"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 := sag.NewDnatEntry(ctx, "default", &sag.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
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.sag.DnatEntry;
import com.pulumi.alicloud.sag.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:sag:DnatEntry
properties:
sagId: ${sagId}
type: Intranet
ipProtocol: any
externalIp: 172.32.0.2
externalPort: any
internalIp: 172.16.0.4
internalPort: any
Import
The Sag DnatEntry can be imported using the id, e.g.
$ pulumi import alicloud:sag/dnatEntry:DnatEntry example sag-abc123456:dnat-abc123456
Constructors
Properties
The external public IP address.when "type" is "Internet",automatically identify the external ip.
The public port.Value range: 1 to 65535 or "any".
The destination private IP address.
The destination private port.Value range: 1 to 65535 or "any".
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.