Dnat Entry
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-2`, `ap-southeast-3`, `ap-southeast-5`, `ap-northeast-1`, `eu-central-1`
Example Usage
Basic Usage
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());
}
}
Content copied to clipboard
Import
The Sag DnatEntry can be imported using the id, e.g.
$ pulumi import alicloud:rocketmq/dnatEntry:DnatEntry example sag-abc123456:dnat-abc123456
Content copied to clipboard