1. Packages
  2. Packages
  3. Volcenginecc Provider
  4. API Docs
  5. natgateway
  6. Snatentry
Viewing docs for volcenginecc v0.0.32
published on Thursday, Apr 23, 2026 by Volcengine
volcenginecc logo
Viewing docs for volcenginecc v0.0.32
published on Thursday, Apr 23, 2026 by Volcengine

    When multiple cloud server instances in a private network need to access the public network, you can use SNAT rules of the public NAT gateway to save public IPs and avoid exposing cloud server IPs directly to the public network for secure, convenient, and efficient access. SNAT rules support four granularities: private network, subnet, cloud server, and custom network segment. Configure flexibly based on your business needs.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcenginecc from "@volcengine/pulumi-volcenginecc";
    
    const natGatewaySnatentryDemo = new volcenginecc.natgateway.Snatentry("NatGatewaySnatentryDemo", {
        natGatewayId: "ngw-2pc28yhdpbx8g227qo1xxxxx",
        eipId: "eip-iivdtssgbdog74o8cuxxxxx,eip-btbv1pk36g3k5h0b2vxxxxx",
        snatEntryName: "test",
        sourceCidr: "0.0.0.0/0",
    });
    
    import pulumi
    import pulumi_volcenginecc as volcenginecc
    
    nat_gateway_snatentry_demo = volcenginecc.natgateway.Snatentry("NatGatewaySnatentryDemo",
        nat_gateway_id="ngw-2pc28yhdpbx8g227qo1xxxxx",
        eip_id="eip-iivdtssgbdog74o8cuxxxxx,eip-btbv1pk36g3k5h0b2vxxxxx",
        snat_entry_name="test",
        source_cidr="0.0.0.0/0")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcenginecc/sdk/go/volcenginecc/natgateway"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := natgateway.NewSnatentry(ctx, "NatGatewaySnatentryDemo", &natgateway.SnatentryArgs{
    			NatGatewayId:  pulumi.String("ngw-2pc28yhdpbx8g227qo1xxxxx"),
    			EipId:         pulumi.String("eip-iivdtssgbdog74o8cuxxxxx,eip-btbv1pk36g3k5h0b2vxxxxx"),
    			SnatEntryName: pulumi.String("test"),
    			SourceCidr:    pulumi.String("0.0.0.0/0"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcenginecc = Volcengine.Pulumi.Volcenginecc;
    
    return await Deployment.RunAsync(() => 
    {
        var natGatewaySnatentryDemo = new Volcenginecc.Natgateway.Snatentry("NatGatewaySnatentryDemo", new()
        {
            NatGatewayId = "ngw-2pc28yhdpbx8g227qo1xxxxx",
            EipId = "eip-iivdtssgbdog74o8cuxxxxx,eip-btbv1pk36g3k5h0b2vxxxxx",
            SnatEntryName = "test",
            SourceCidr = "0.0.0.0/0",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.volcengine.volcenginecc.natgateway.Snatentry;
    import com.volcengine.volcenginecc.natgateway.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 natGatewaySnatentryDemo = new Snatentry("natGatewaySnatentryDemo", SnatentryArgs.builder()
                .natGatewayId("ngw-2pc28yhdpbx8g227qo1xxxxx")
                .eipId("eip-iivdtssgbdog74o8cuxxxxx,eip-btbv1pk36g3k5h0b2vxxxxx")
                .snatEntryName("test")
                .sourceCidr("0.0.0.0/0")
                .build());
    
        }
    }
    
    resources:
      natGatewaySnatentryDemo:
        type: volcenginecc:natgateway:Snatentry
        name: NatGatewaySnatentryDemo
        properties:
          natGatewayId: ngw-2pc28yhdpbx8g227qo1xxxxx
          eipId: eip-iivdtssgbdog74o8cuxxxxx,eip-btbv1pk36g3k5h0b2vxxxxx
          snatEntryName: test
          sourceCidr: 0.0.0.0/0
    

    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,
                  nat_gateway_id: Optional[str] = None,
                  eip_id: Optional[str] = None,
                  nat_ip_id: Optional[str] = None,
                  snat_entry_name: Optional[str] = None,
                  source_cidr: Optional[str] = None,
                  subnet_id: 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: volcenginecc:natgateway: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 Volcenginecc.Natgateway.Snatentry("snatentryResource", new()
    {
        NatGatewayId = "string",
        EipId = "string",
        NatIpId = "string",
        SnatEntryName = "string",
        SourceCidr = "string",
        SubnetId = "string",
    });
    
    example, err := natgateway.NewSnatentry(ctx, "snatentryResource", &natgateway.SnatentryArgs{
    	NatGatewayId:  pulumi.String("string"),
    	EipId:         pulumi.String("string"),
    	NatIpId:       pulumi.String("string"),
    	SnatEntryName: pulumi.String("string"),
    	SourceCidr:    pulumi.String("string"),
    	SubnetId:      pulumi.String("string"),
    })
    
    var snatentryResource = new Snatentry("snatentryResource", SnatentryArgs.builder()
        .natGatewayId("string")
        .eipId("string")
        .natIpId("string")
        .snatEntryName("string")
        .sourceCidr("string")
        .subnetId("string")
        .build());
    
    snatentry_resource = volcenginecc.natgateway.Snatentry("snatentryResource",
        nat_gateway_id="string",
        eip_id="string",
        nat_ip_id="string",
        snat_entry_name="string",
        source_cidr="string",
        subnet_id="string")
    
    const snatentryResource = new volcenginecc.natgateway.Snatentry("snatentryResource", {
        natGatewayId: "string",
        eipId: "string",
        natIpId: "string",
        snatEntryName: "string",
        sourceCidr: "string",
        subnetId: "string",
    });
    
    type: volcenginecc:natgateway:Snatentry
    properties:
        eipId: string
        natGatewayId: string
        natIpId: string
        snatEntryName: string
        sourceCidr: string
        subnetId: 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

    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:

    NatGatewayId string
    ID of the NAT gateway associated with the SNAT rule
    EipId string
    ID of the public IP associated with the SNAT rule. Returns the ID for a single public IP. Returns IDs for multiple public IPs.
    NatIpId string
    ID of the transit IP for the private NAT gateway
    SnatEntryName string
    Name of the SNAT rule
    SourceCidr string
    Network segment corresponding to the SNAT rule
    SubnetId string
    ID of the subnet associated with the SNAT rule
    NatGatewayId string
    ID of the NAT gateway associated with the SNAT rule
    EipId string
    ID of the public IP associated with the SNAT rule. Returns the ID for a single public IP. Returns IDs for multiple public IPs.
    NatIpId string
    ID of the transit IP for the private NAT gateway
    SnatEntryName string
    Name of the SNAT rule
    SourceCidr string
    Network segment corresponding to the SNAT rule
    SubnetId string
    ID of the subnet associated with the SNAT rule
    natGatewayId String
    ID of the NAT gateway associated with the SNAT rule
    eipId String
    ID of the public IP associated with the SNAT rule. Returns the ID for a single public IP. Returns IDs for multiple public IPs.
    natIpId String
    ID of the transit IP for the private NAT gateway
    snatEntryName String
    Name of the SNAT rule
    sourceCidr String
    Network segment corresponding to the SNAT rule
    subnetId String
    ID of the subnet associated with the SNAT rule
    natGatewayId string
    ID of the NAT gateway associated with the SNAT rule
    eipId string
    ID of the public IP associated with the SNAT rule. Returns the ID for a single public IP. Returns IDs for multiple public IPs.
    natIpId string
    ID of the transit IP for the private NAT gateway
    snatEntryName string
    Name of the SNAT rule
    sourceCidr string
    Network segment corresponding to the SNAT rule
    subnetId string
    ID of the subnet associated with the SNAT rule
    nat_gateway_id str
    ID of the NAT gateway associated with the SNAT rule
    eip_id str
    ID of the public IP associated with the SNAT rule. Returns the ID for a single public IP. Returns IDs for multiple public IPs.
    nat_ip_id str
    ID of the transit IP for the private NAT gateway
    snat_entry_name str
    Name of the SNAT rule
    source_cidr str
    Network segment corresponding to the SNAT rule
    subnet_id str
    ID of the subnet associated with the SNAT rule
    natGatewayId String
    ID of the NAT gateway associated with the SNAT rule
    eipId String
    ID of the public IP associated with the SNAT rule. Returns the ID for a single public IP. Returns IDs for multiple public IPs.
    natIpId String
    ID of the transit IP for the private NAT gateway
    snatEntryName String
    Name of the SNAT rule
    sourceCidr String
    Network segment corresponding to the SNAT rule
    subnetId String
    ID of the subnet associated with the SNAT rule

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Snatentry resource produces the following output properties:

    EipAddress string
    IP address of the public IP associated with the SNAT rule. Returns the IP address for a single public IP. Returns IP addresses for multiple public IPs.
    Id string
    The provider-assigned unique ID for this managed resource.
    SnatEntryId string
    ID of the SNAT rule
    Status string
    Status of the SNAT rule. Creating: being created. Deleting: being deleted. Available: available.
    EipAddress string
    IP address of the public IP associated with the SNAT rule. Returns the IP address for a single public IP. Returns IP addresses for multiple public IPs.
    Id string
    The provider-assigned unique ID for this managed resource.
    SnatEntryId string
    ID of the SNAT rule
    Status string
    Status of the SNAT rule. Creating: being created. Deleting: being deleted. Available: available.
    eipAddress String
    IP address of the public IP associated with the SNAT rule. Returns the IP address for a single public IP. Returns IP addresses for multiple public IPs.
    id String
    The provider-assigned unique ID for this managed resource.
    snatEntryId String
    ID of the SNAT rule
    status String
    Status of the SNAT rule. Creating: being created. Deleting: being deleted. Available: available.
    eipAddress string
    IP address of the public IP associated with the SNAT rule. Returns the IP address for a single public IP. Returns IP addresses for multiple public IPs.
    id string
    The provider-assigned unique ID for this managed resource.
    snatEntryId string
    ID of the SNAT rule
    status string
    Status of the SNAT rule. Creating: being created. Deleting: being deleted. Available: available.
    eip_address str
    IP address of the public IP associated with the SNAT rule. Returns the IP address for a single public IP. Returns IP addresses for multiple public IPs.
    id str
    The provider-assigned unique ID for this managed resource.
    snat_entry_id str
    ID of the SNAT rule
    status str
    Status of the SNAT rule. Creating: being created. Deleting: being deleted. Available: available.
    eipAddress String
    IP address of the public IP associated with the SNAT rule. Returns the IP address for a single public IP. Returns IP addresses for multiple public IPs.
    id String
    The provider-assigned unique ID for this managed resource.
    snatEntryId String
    ID of the SNAT rule
    status String
    Status of the SNAT rule. Creating: being created. Deleting: being deleted. Available: available.

    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,
            eip_address: Optional[str] = None,
            eip_id: Optional[str] = None,
            nat_gateway_id: Optional[str] = None,
            nat_ip_id: Optional[str] = None,
            snat_entry_id: Optional[str] = None,
            snat_entry_name: Optional[str] = None,
            source_cidr: Optional[str] = None,
            status: Optional[str] = None,
            subnet_id: 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: volcenginecc:natgateway:Snatentry    get:      id: ${id}
    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:
    EipAddress string
    IP address of the public IP associated with the SNAT rule. Returns the IP address for a single public IP. Returns IP addresses for multiple public IPs.
    EipId string
    ID of the public IP associated with the SNAT rule. Returns the ID for a single public IP. Returns IDs for multiple public IPs.
    NatGatewayId string
    ID of the NAT gateway associated with the SNAT rule
    NatIpId string
    ID of the transit IP for the private NAT gateway
    SnatEntryId string
    ID of the SNAT rule
    SnatEntryName string
    Name of the SNAT rule
    SourceCidr string
    Network segment corresponding to the SNAT rule
    Status string
    Status of the SNAT rule. Creating: being created. Deleting: being deleted. Available: available.
    SubnetId string
    ID of the subnet associated with the SNAT rule
    EipAddress string
    IP address of the public IP associated with the SNAT rule. Returns the IP address for a single public IP. Returns IP addresses for multiple public IPs.
    EipId string
    ID of the public IP associated with the SNAT rule. Returns the ID for a single public IP. Returns IDs for multiple public IPs.
    NatGatewayId string
    ID of the NAT gateway associated with the SNAT rule
    NatIpId string
    ID of the transit IP for the private NAT gateway
    SnatEntryId string
    ID of the SNAT rule
    SnatEntryName string
    Name of the SNAT rule
    SourceCidr string
    Network segment corresponding to the SNAT rule
    Status string
    Status of the SNAT rule. Creating: being created. Deleting: being deleted. Available: available.
    SubnetId string
    ID of the subnet associated with the SNAT rule
    eipAddress String
    IP address of the public IP associated with the SNAT rule. Returns the IP address for a single public IP. Returns IP addresses for multiple public IPs.
    eipId String
    ID of the public IP associated with the SNAT rule. Returns the ID for a single public IP. Returns IDs for multiple public IPs.
    natGatewayId String
    ID of the NAT gateway associated with the SNAT rule
    natIpId String
    ID of the transit IP for the private NAT gateway
    snatEntryId String
    ID of the SNAT rule
    snatEntryName String
    Name of the SNAT rule
    sourceCidr String
    Network segment corresponding to the SNAT rule
    status String
    Status of the SNAT rule. Creating: being created. Deleting: being deleted. Available: available.
    subnetId String
    ID of the subnet associated with the SNAT rule
    eipAddress string
    IP address of the public IP associated with the SNAT rule. Returns the IP address for a single public IP. Returns IP addresses for multiple public IPs.
    eipId string
    ID of the public IP associated with the SNAT rule. Returns the ID for a single public IP. Returns IDs for multiple public IPs.
    natGatewayId string
    ID of the NAT gateway associated with the SNAT rule
    natIpId string
    ID of the transit IP for the private NAT gateway
    snatEntryId string
    ID of the SNAT rule
    snatEntryName string
    Name of the SNAT rule
    sourceCidr string
    Network segment corresponding to the SNAT rule
    status string
    Status of the SNAT rule. Creating: being created. Deleting: being deleted. Available: available.
    subnetId string
    ID of the subnet associated with the SNAT rule
    eip_address str
    IP address of the public IP associated with the SNAT rule. Returns the IP address for a single public IP. Returns IP addresses for multiple public IPs.
    eip_id str
    ID of the public IP associated with the SNAT rule. Returns the ID for a single public IP. Returns IDs for multiple public IPs.
    nat_gateway_id str
    ID of the NAT gateway associated with the SNAT rule
    nat_ip_id str
    ID of the transit IP for the private NAT gateway
    snat_entry_id str
    ID of the SNAT rule
    snat_entry_name str
    Name of the SNAT rule
    source_cidr str
    Network segment corresponding to the SNAT rule
    status str
    Status of the SNAT rule. Creating: being created. Deleting: being deleted. Available: available.
    subnet_id str
    ID of the subnet associated with the SNAT rule
    eipAddress String
    IP address of the public IP associated with the SNAT rule. Returns the IP address for a single public IP. Returns IP addresses for multiple public IPs.
    eipId String
    ID of the public IP associated with the SNAT rule. Returns the ID for a single public IP. Returns IDs for multiple public IPs.
    natGatewayId String
    ID of the NAT gateway associated with the SNAT rule
    natIpId String
    ID of the transit IP for the private NAT gateway
    snatEntryId String
    ID of the SNAT rule
    snatEntryName String
    Name of the SNAT rule
    sourceCidr String
    Network segment corresponding to the SNAT rule
    status String
    Status of the SNAT rule. Creating: being created. Deleting: being deleted. Available: available.
    subnetId String
    ID of the subnet associated with the SNAT rule

    Import

    $ pulumi import volcenginecc:natgateway/snatentry:Snatentry example "snat_entry_id"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    volcenginecc volcengine/pulumi-volcenginecc
    License
    MPL-2.0
    Notes
    This Pulumi package is based on the volcenginecc Terraform Provider.
    volcenginecc logo
    Viewing docs for volcenginecc v0.0.32
    published on Thursday, Apr 23, 2026 by Volcengine
      Try Pulumi Cloud free. Your team will thank you.