Alibaba Cloud
SnatEntry
Provides a Sag SnatEntry resource. This topic describes how to add a SNAT entry to enable the SNAT function. The SNAT function can hide internal IP addresses and resolve private IP address conflicts. With this function, on-premises sites can access internal IP addresses, but cannot be accessed by internal IP addresses. If you do not add a SNAT entry, on-premises sites can access each other only when all related IP addresses do not conflict.
For information about Sag SnatEntry and how to use it, see What is Sag SnatEntry.
NOTE: Available in 1.61.0+
NOTE: Only the following regions support. [
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
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var @default = new AliCloud.RocketMQ.SnatEntry("default", new AliCloud.RocketMQ.SnatEntryArgs
{
CidrBlock = "192.168.7.0/24",
SagId = "sag-3rb1t3iagy3w0zgwy9",
SnatIp = "192.0.0.2",
});
}
}
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.NewSnatEntry(ctx, "default", &rocketmq.SnatEntryArgs{
CidrBlock: pulumi.String("192.168.7.0/24"),
SagId: pulumi.String("sag-3rb1t3iagy3w0zgwy9"),
SnatIp: pulumi.String("192.0.0.2"),
})
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.SnatEntry;
import com.pulumi.alicloud.rocketmq.SnatEntryArgs;
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 SnatEntry("default", SnatEntryArgs.builder()
.cidrBlock("192.168.7.0/24")
.sagId("sag-3rb1t3iagy3w0zgwy9")
.snatIp("192.0.0.2")
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.rocketmq.SnatEntry("default",
cidr_block="192.168.7.0/24",
sag_id="sag-3rb1t3iagy3w0zgwy9",
snat_ip="192.0.0.2")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const defaultSnatEntry = new alicloud.rocketmq.SnatEntry("default", {
cidrBlock: "192.168.7.0/24",
sagId: "sag-3rb1t3iagy3w0zgwy9",
snatIp: "192.0.0.2",
});
resources:
default:
type: alicloud:rocketmq:SnatEntry
properties:
cidrBlock: 192.168.7.0/24
sagId: sag-3rb1t3iagy3w0zgwy9
snatIp: 192.0.0.2
Create a SnatEntry Resource
new SnatEntry(name: string, args: SnatEntryArgs, opts?: CustomResourceOptions);
@overload
def SnatEntry(resource_name: str,
opts: Optional[ResourceOptions] = None,
cidr_block: Optional[str] = None,
sag_id: Optional[str] = None,
snat_ip: Optional[str] = None)
@overload
def SnatEntry(resource_name: str,
args: SnatEntryArgs,
opts: Optional[ResourceOptions] = None)
func NewSnatEntry(ctx *Context, name string, args SnatEntryArgs, opts ...ResourceOption) (*SnatEntry, error)
public SnatEntry(string name, SnatEntryArgs args, CustomResourceOptions? opts = null)
public SnatEntry(String name, SnatEntryArgs args)
public SnatEntry(String name, SnatEntryArgs args, CustomResourceOptions options)
type: alicloud:rocketmq:SnatEntry
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SnatEntryArgs
- 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 SnatEntryArgs
- 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 SnatEntryArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SnatEntryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SnatEntryArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
SnatEntry 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 SnatEntry resource accepts the following input properties:
- cidr_
block str The destination CIDR block.
- sag_
id str The ID of the SAG instance.
- snat_
ip str The public IP address.
Outputs
All input properties are implicitly available as output properties. Additionally, the SnatEntry 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 an Existing SnatEntry Resource
Get an existing SnatEntry 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?: SnatEntryState, opts?: CustomResourceOptions): SnatEntry
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cidr_block: Optional[str] = None,
sag_id: Optional[str] = None,
snat_ip: Optional[str] = None) -> SnatEntry
func GetSnatEntry(ctx *Context, name string, id IDInput, state *SnatEntryState, opts ...ResourceOption) (*SnatEntry, error)
public static SnatEntry Get(string name, Input<string> id, SnatEntryState? state, CustomResourceOptions? opts = null)
public static SnatEntry get(String name, Output<String> id, SnatEntryState 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.
- cidr_
block str The destination CIDR block.
- sag_
id str The ID of the SAG instance.
- snat_
ip str The public IP address.
Import
The Sag SnatEntry can be imported using the id, e.g.
$ pulumi import alicloud:rocketmq/snatEntry:SnatEntry example sag-abc123456:snat-abc123456
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.