1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. rocketmq
  5. SnatEntry
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.rocketmq.SnatEntry

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    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.rocketmq.SnatEntry("default", {
        sagId: sagId,
        cidrBlock: "192.168.7.0/24",
        snatIp: "192.0.0.2",
    });
    
    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.rocketmq.SnatEntry("default",
        sag_id=sag_id,
        cidr_block="192.168.7.0/24",
        snat_ip="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"
    	"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 := rocketmq.NewSnatEntry(ctx, "default", &rocketmq.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
    	})
    }
    
    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.RocketMQ.SnatEntry("default", new()
        {
            SagId = sagId,
            CidrBlock = "192.168.7.0/24",
            SnatIp = "192.0.0.2",
        });
    
    });
    
    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) {
            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());
    
        }
    }
    
    configuration:
      sagId:
        type: string
        default: sag-9bifk***
    resources:
      default:
        type: alicloud:rocketmq:SnatEntry
        properties:
          sagId: ${sagId}
          cidrBlock: 192.168.7.0/24
          snatIp: 192.0.0.2
    

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

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var snatEntryResource = new AliCloud.RocketMQ.SnatEntry("snatEntryResource", new()
    {
        CidrBlock = "string",
        SagId = "string",
        SnatIp = "string",
    });
    
    example, err := rocketmq.NewSnatEntry(ctx, "snatEntryResource", &rocketmq.SnatEntryArgs{
    	CidrBlock: pulumi.String("string"),
    	SagId:     pulumi.String("string"),
    	SnatIp:    pulumi.String("string"),
    })
    
    var snatEntryResource = new SnatEntry("snatEntryResource", SnatEntryArgs.builder()
        .cidrBlock("string")
        .sagId("string")
        .snatIp("string")
        .build());
    
    snat_entry_resource = alicloud.rocketmq.SnatEntry("snatEntryResource",
        cidr_block="string",
        sag_id="string",
        snat_ip="string")
    
    const snatEntryResource = new alicloud.rocketmq.SnatEntry("snatEntryResource", {
        cidrBlock: "string",
        sagId: "string",
        snatIp: "string",
    });
    
    type: alicloud:rocketmq:SnatEntry
    properties:
        cidrBlock: string
        sagId: string
        snatIp: string
    

    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:

    CidrBlock string
    The destination CIDR block.
    SagId string
    The ID of the SAG instance.
    SnatIp string
    The public IP address.
    CidrBlock string
    The destination CIDR block.
    SagId string
    The ID of the SAG instance.
    SnatIp string
    The public IP address.
    cidrBlock String
    The destination CIDR block.
    sagId String
    The ID of the SAG instance.
    snatIp String
    The public IP address.
    cidrBlock string
    The destination CIDR block.
    sagId string
    The ID of the SAG instance.
    snatIp string
    The public IP address.
    cidr_block str
    The destination CIDR block.
    sag_id str
    The ID of the SAG instance.
    snat_ip str
    The public IP address.
    cidrBlock String
    The destination CIDR block.
    sagId String
    The ID of the SAG instance.
    snatIp 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)
    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.
    The following state arguments are supported:
    CidrBlock string
    The destination CIDR block.
    SagId string
    The ID of the SAG instance.
    SnatIp string
    The public IP address.
    CidrBlock string
    The destination CIDR block.
    SagId string
    The ID of the SAG instance.
    SnatIp string
    The public IP address.
    cidrBlock String
    The destination CIDR block.
    sagId String
    The ID of the SAG instance.
    snatIp String
    The public IP address.
    cidrBlock string
    The destination CIDR block.
    sagId string
    The ID of the SAG instance.
    snatIp string
    The public IP address.
    cidr_block str
    The destination CIDR block.
    sag_id str
    The ID of the SAG instance.
    snat_ip str
    The public IP address.
    cidrBlock String
    The destination CIDR block.
    sagId String
    The ID of the SAG instance.
    snatIp 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
    

    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.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi