1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. rocketmq
  5. SnatEntry
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.rocketmq.SnatEntry

Explore with Pulumi AI

Deprecated: alicloud.rocketmq/snatentry.SnatEntry has been deprecated in favor of alicloud.sag/snatentry.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 since v1.61.0.

NOTE: Only the following regions support. [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-9bifk***";
const _default = new alicloud.sag.SnatEntry("default", {
    sagId: sagId,
    cidrBlock: "192.168.7.0/24",
    snatIp: "192.0.0.2",
});
Copy
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
sag_id = config.get("sagId")
if sag_id is None:
    sag_id = "sag-9bifk***"
default = alicloud.sag.SnatEntry("default",
    sag_id=sag_id,
    cidr_block="192.168.7.0/24",
    snat_ip="192.0.0.2")
Copy
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-9bifk***"
		if param := cfg.Get("sagId"); param != "" {
			sagId = param
		}
		_, err := sag.NewSnatEntry(ctx, "default", &sag.SnatEntryArgs{
			SagId:     pulumi.String(sagId),
			CidrBlock: pulumi.String("192.168.7.0/24"),
			SnatIp:    pulumi.String("192.0.0.2"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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-9bifk***";
    var @default = new AliCloud.Sag.SnatEntry("default", new()
    {
        SagId = sagId,
        CidrBlock = "192.168.7.0/24",
        SnatIp = "192.0.0.2",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.sag.SnatEntry;
import com.pulumi.alicloud.sag.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) {
        final var config = ctx.config();
        final var sagId = config.get("sagId").orElse("sag-9bifk***");
        var default_ = new SnatEntry("default", SnatEntryArgs.builder()
            .sagId(sagId)
            .cidrBlock("192.168.7.0/24")
            .snatIp("192.0.0.2")
            .build());

    }
}
Copy
configuration:
  sagId:
    type: string
    default: sag-9bifk***
resources:
  default:
    type: alicloud:sag:SnatEntry
    properties:
      sagId: ${sagId}
      cidrBlock: 192.168.7.0/24
      snatIp: 192.0.0.2
Copy

Create SnatEntry Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new SnatEntry(name: string, args: SnatEntryArgs, opts?: CustomResourceOptions);
@overload
def SnatEntry(resource_name: str,
              args: SnatEntryArgs,
              opts: Optional[ResourceOptions] = None)

@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)
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.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SnatEntryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. SnatEntryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SnatEntryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The SnatEntry resource accepts the following input properties:

CidrBlock
This property is required.
Changes to this property will trigger replacement.
string
The destination CIDR block.
SagId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the SAG instance.
SnatIp
This property is required.
Changes to this property will trigger replacement.
string
The public IP address.
CidrBlock
This property is required.
Changes to this property will trigger replacement.
string
The destination CIDR block.
SagId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the SAG instance.
SnatIp
This property is required.
Changes to this property will trigger replacement.
string
The public IP address.
cidrBlock
This property is required.
Changes to this property will trigger replacement.
String
The destination CIDR block.
sagId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the SAG instance.
snatIp
This property is required.
Changes to this property will trigger replacement.
String
The public IP address.
cidrBlock
This property is required.
Changes to this property will trigger replacement.
string
The destination CIDR block.
sagId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the SAG instance.
snatIp
This property is required.
Changes to this property will trigger replacement.
string
The public IP address.
cidr_block
This property is required.
Changes to this property will trigger replacement.
str
The destination CIDR block.
sag_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the SAG instance.
snat_ip
This property is required.
Changes to this property will trigger replacement.
str
The public IP address.
cidrBlock
This property is required.
Changes to this property will trigger replacement.
String
The destination CIDR block.
sagId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the SAG instance.
snatIp
This property is required.
Changes to this property will trigger replacement.
String
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 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)
resources:  _:    type: alicloud:rocketmq:SnatEntry    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CidrBlock Changes to this property will trigger replacement. string
The destination CIDR block.
SagId Changes to this property will trigger replacement. string
The ID of the SAG instance.
SnatIp Changes to this property will trigger replacement. string
The public IP address.
CidrBlock Changes to this property will trigger replacement. string
The destination CIDR block.
SagId Changes to this property will trigger replacement. string
The ID of the SAG instance.
SnatIp Changes to this property will trigger replacement. string
The public IP address.
cidrBlock Changes to this property will trigger replacement. String
The destination CIDR block.
sagId Changes to this property will trigger replacement. String
The ID of the SAG instance.
snatIp Changes to this property will trigger replacement. String
The public IP address.
cidrBlock Changes to this property will trigger replacement. string
The destination CIDR block.
sagId Changes to this property will trigger replacement. string
The ID of the SAG instance.
snatIp Changes to this property will trigger replacement. string
The public IP address.
cidr_block Changes to this property will trigger replacement. str
The destination CIDR block.
sag_id Changes to this property will trigger replacement. str
The ID of the SAG instance.
snat_ip Changes to this property will trigger replacement. str
The public IP address.
cidrBlock Changes to this property will trigger replacement. String
The destination CIDR block.
sagId Changes to this property will trigger replacement. String
The ID of the SAG instance.
snatIp Changes to this property will trigger replacement. String
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
Copy

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.