1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. DcGateway
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.DcGateway

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to creating direct connect gateway instance.

    Example Usage

    If network_type is VPC

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    // create vpc
    const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
    // create dc gateway
    const example = new tencentcloud.DcGateway("example", {
        networkInstanceId: vpc.vpcId,
        networkType: "VPC",
        gatewayType: "NORMAL",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    # create vpc
    vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
    # create dc gateway
    example = tencentcloud.DcGateway("example",
        network_instance_id=vpc.vpc_id,
        network_type="VPC",
        gateway_type="NORMAL")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// create vpc
    		vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
    			CidrBlock: pulumi.String("10.0.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		// create dc gateway
    		_, err = tencentcloud.NewDcGateway(ctx, "example", &tencentcloud.DcGatewayArgs{
    			NetworkInstanceId: vpc.VpcId,
    			NetworkType:       pulumi.String("VPC"),
    			GatewayType:       pulumi.String("NORMAL"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        // create vpc
        var vpc = new Tencentcloud.Vpc("vpc", new()
        {
            CidrBlock = "10.0.0.0/16",
        });
    
        // create dc gateway
        var example = new Tencentcloud.DcGateway("example", new()
        {
            NetworkInstanceId = vpc.VpcId,
            NetworkType = "VPC",
            GatewayType = "NORMAL",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.Vpc;
    import com.pulumi.tencentcloud.VpcArgs;
    import com.pulumi.tencentcloud.DcGateway;
    import com.pulumi.tencentcloud.DcGatewayArgs;
    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) {
            // create vpc
            var vpc = new Vpc("vpc", VpcArgs.builder()
                .cidrBlock("10.0.0.0/16")
                .build());
    
            // create dc gateway
            var example = new DcGateway("example", DcGatewayArgs.builder()
                .networkInstanceId(vpc.vpcId())
                .networkType("VPC")
                .gatewayType("NORMAL")
                .build());
    
        }
    }
    
    resources:
      # create vpc
      vpc:
        type: tencentcloud:Vpc
        properties:
          cidrBlock: 10.0.0.0/16
      # create dc gateway
      example:
        type: tencentcloud:DcGateway
        properties:
          networkInstanceId: ${vpc.vpcId}
          networkType: VPC
          gatewayType: NORMAL
    

    If network_type is CCN

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    // create ccn
    const ccn = new tencentcloud.Ccn("ccn", {
        description: "desc.",
        qos: "AG",
        chargeType: "PREPAID",
        bandwidthLimitType: "INTER_REGION_LIMIT",
        tags: {
            createBy: "terraform",
        },
    });
    // create dc gateway
    const example = new tencentcloud.DcGateway("example", {
        networkInstanceId: ccn.ccnId,
        networkType: "CCN",
        gatewayType: "NORMAL",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    # create ccn
    ccn = tencentcloud.Ccn("ccn",
        description="desc.",
        qos="AG",
        charge_type="PREPAID",
        bandwidth_limit_type="INTER_REGION_LIMIT",
        tags={
            "createBy": "terraform",
        })
    # create dc gateway
    example = tencentcloud.DcGateway("example",
        network_instance_id=ccn.ccn_id,
        network_type="CCN",
        gateway_type="NORMAL")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// create ccn
    		ccn, err := tencentcloud.NewCcn(ctx, "ccn", &tencentcloud.CcnArgs{
    			Description:        pulumi.String("desc."),
    			Qos:                pulumi.String("AG"),
    			ChargeType:         pulumi.String("PREPAID"),
    			BandwidthLimitType: pulumi.String("INTER_REGION_LIMIT"),
    			Tags: pulumi.StringMap{
    				"createBy": pulumi.String("terraform"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// create dc gateway
    		_, err = tencentcloud.NewDcGateway(ctx, "example", &tencentcloud.DcGatewayArgs{
    			NetworkInstanceId: ccn.CcnId,
    			NetworkType:       pulumi.String("CCN"),
    			GatewayType:       pulumi.String("NORMAL"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        // create ccn
        var ccn = new Tencentcloud.Ccn("ccn", new()
        {
            Description = "desc.",
            Qos = "AG",
            ChargeType = "PREPAID",
            BandwidthLimitType = "INTER_REGION_LIMIT",
            Tags = 
            {
                { "createBy", "terraform" },
            },
        });
    
        // create dc gateway
        var example = new Tencentcloud.DcGateway("example", new()
        {
            NetworkInstanceId = ccn.CcnId,
            NetworkType = "CCN",
            GatewayType = "NORMAL",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.Ccn;
    import com.pulumi.tencentcloud.CcnArgs;
    import com.pulumi.tencentcloud.DcGateway;
    import com.pulumi.tencentcloud.DcGatewayArgs;
    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) {
            // create ccn
            var ccn = new Ccn("ccn", CcnArgs.builder()
                .description("desc.")
                .qos("AG")
                .chargeType("PREPAID")
                .bandwidthLimitType("INTER_REGION_LIMIT")
                .tags(Map.of("createBy", "terraform"))
                .build());
    
            // create dc gateway
            var example = new DcGateway("example", DcGatewayArgs.builder()
                .networkInstanceId(ccn.ccnId())
                .networkType("CCN")
                .gatewayType("NORMAL")
                .build());
    
        }
    }
    
    resources:
      # create ccn
      ccn:
        type: tencentcloud:Ccn
        properties:
          description: desc.
          qos: AG
          chargeType: PREPAID
          bandwidthLimitType: INTER_REGION_LIMIT
          tags:
            createBy: terraform
      # create dc gateway
      example:
        type: tencentcloud:DcGateway
        properties:
          networkInstanceId: ${ccn.ccnId}
          networkType: CCN
          gatewayType: NORMAL
    

    Create DcGateway Resource

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

    Constructor syntax

    new DcGateway(name: string, args: DcGatewayArgs, opts?: CustomResourceOptions);
    @overload
    def DcGateway(resource_name: str,
                  args: DcGatewayArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def DcGateway(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  network_instance_id: Optional[str] = None,
                  network_type: Optional[str] = None,
                  dc_gateway_id: Optional[str] = None,
                  gateway_type: Optional[str] = None,
                  name: Optional[str] = None)
    func NewDcGateway(ctx *Context, name string, args DcGatewayArgs, opts ...ResourceOption) (*DcGateway, error)
    public DcGateway(string name, DcGatewayArgs args, CustomResourceOptions? opts = null)
    public DcGateway(String name, DcGatewayArgs args)
    public DcGateway(String name, DcGatewayArgs args, CustomResourceOptions options)
    
    type: tencentcloud:DcGateway
    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 DcGatewayArgs
    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 DcGatewayArgs
    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 DcGatewayArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DcGatewayArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DcGatewayArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    DcGateway 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 DcGateway resource accepts the following input properties:

    NetworkInstanceId string
    If the network_type value is VPC, the available value is VPC ID. But when the network_type value is CCN, the available value is CCN instance ID.
    NetworkType string
    Type of associated network. Valid value: VPC and CCN.
    DcGatewayId string
    ID of the resource.
    GatewayType string
    Type of the gateway. Valid value: NORMAL and NAT. Default is NORMAL. NOTES: CCN only supports NORMAL and a VPC can create two DCGs, the one is NAT type and the other is non-NAT type.
    Name string
    Name of the DCG.
    NetworkInstanceId string
    If the network_type value is VPC, the available value is VPC ID. But when the network_type value is CCN, the available value is CCN instance ID.
    NetworkType string
    Type of associated network. Valid value: VPC and CCN.
    DcGatewayId string
    ID of the resource.
    GatewayType string
    Type of the gateway. Valid value: NORMAL and NAT. Default is NORMAL. NOTES: CCN only supports NORMAL and a VPC can create two DCGs, the one is NAT type and the other is non-NAT type.
    Name string
    Name of the DCG.
    networkInstanceId String
    If the network_type value is VPC, the available value is VPC ID. But when the network_type value is CCN, the available value is CCN instance ID.
    networkType String
    Type of associated network. Valid value: VPC and CCN.
    dcGatewayId String
    ID of the resource.
    gatewayType String
    Type of the gateway. Valid value: NORMAL and NAT. Default is NORMAL. NOTES: CCN only supports NORMAL and a VPC can create two DCGs, the one is NAT type and the other is non-NAT type.
    name String
    Name of the DCG.
    networkInstanceId string
    If the network_type value is VPC, the available value is VPC ID. But when the network_type value is CCN, the available value is CCN instance ID.
    networkType string
    Type of associated network. Valid value: VPC and CCN.
    dcGatewayId string
    ID of the resource.
    gatewayType string
    Type of the gateway. Valid value: NORMAL and NAT. Default is NORMAL. NOTES: CCN only supports NORMAL and a VPC can create two DCGs, the one is NAT type and the other is non-NAT type.
    name string
    Name of the DCG.
    network_instance_id str
    If the network_type value is VPC, the available value is VPC ID. But when the network_type value is CCN, the available value is CCN instance ID.
    network_type str
    Type of associated network. Valid value: VPC and CCN.
    dc_gateway_id str
    ID of the resource.
    gateway_type str
    Type of the gateway. Valid value: NORMAL and NAT. Default is NORMAL. NOTES: CCN only supports NORMAL and a VPC can create two DCGs, the one is NAT type and the other is non-NAT type.
    name str
    Name of the DCG.
    networkInstanceId String
    If the network_type value is VPC, the available value is VPC ID. But when the network_type value is CCN, the available value is CCN instance ID.
    networkType String
    Type of associated network. Valid value: VPC and CCN.
    dcGatewayId String
    ID of the resource.
    gatewayType String
    Type of the gateway. Valid value: NORMAL and NAT. Default is NORMAL. NOTES: CCN only supports NORMAL and a VPC can create two DCGs, the one is NAT type and the other is non-NAT type.
    name String
    Name of the DCG.

    Outputs

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

    CnnRouteType string
    Type of CCN route. Valid value: BGP and STATIC. The property is available when the DCG type is CCN gateway and BGP enabled.
    CreateTime string
    Creation time of resource.
    EnableBgp bool
    Indicates whether the BGP is enabled.
    Id string
    The provider-assigned unique ID for this managed resource.
    CnnRouteType string
    Type of CCN route. Valid value: BGP and STATIC. The property is available when the DCG type is CCN gateway and BGP enabled.
    CreateTime string
    Creation time of resource.
    EnableBgp bool
    Indicates whether the BGP is enabled.
    Id string
    The provider-assigned unique ID for this managed resource.
    cnnRouteType String
    Type of CCN route. Valid value: BGP and STATIC. The property is available when the DCG type is CCN gateway and BGP enabled.
    createTime String
    Creation time of resource.
    enableBgp Boolean
    Indicates whether the BGP is enabled.
    id String
    The provider-assigned unique ID for this managed resource.
    cnnRouteType string
    Type of CCN route. Valid value: BGP and STATIC. The property is available when the DCG type is CCN gateway and BGP enabled.
    createTime string
    Creation time of resource.
    enableBgp boolean
    Indicates whether the BGP is enabled.
    id string
    The provider-assigned unique ID for this managed resource.
    cnn_route_type str
    Type of CCN route. Valid value: BGP and STATIC. The property is available when the DCG type is CCN gateway and BGP enabled.
    create_time str
    Creation time of resource.
    enable_bgp bool
    Indicates whether the BGP is enabled.
    id str
    The provider-assigned unique ID for this managed resource.
    cnnRouteType String
    Type of CCN route. Valid value: BGP and STATIC. The property is available when the DCG type is CCN gateway and BGP enabled.
    createTime String
    Creation time of resource.
    enableBgp Boolean
    Indicates whether the BGP is enabled.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DcGateway Resource

    Get an existing DcGateway 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?: DcGatewayState, opts?: CustomResourceOptions): DcGateway
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cnn_route_type: Optional[str] = None,
            create_time: Optional[str] = None,
            dc_gateway_id: Optional[str] = None,
            enable_bgp: Optional[bool] = None,
            gateway_type: Optional[str] = None,
            name: Optional[str] = None,
            network_instance_id: Optional[str] = None,
            network_type: Optional[str] = None) -> DcGateway
    func GetDcGateway(ctx *Context, name string, id IDInput, state *DcGatewayState, opts ...ResourceOption) (*DcGateway, error)
    public static DcGateway Get(string name, Input<string> id, DcGatewayState? state, CustomResourceOptions? opts = null)
    public static DcGateway get(String name, Output<String> id, DcGatewayState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:DcGateway    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:
    CnnRouteType string
    Type of CCN route. Valid value: BGP and STATIC. The property is available when the DCG type is CCN gateway and BGP enabled.
    CreateTime string
    Creation time of resource.
    DcGatewayId string
    ID of the resource.
    EnableBgp bool
    Indicates whether the BGP is enabled.
    GatewayType string
    Type of the gateway. Valid value: NORMAL and NAT. Default is NORMAL. NOTES: CCN only supports NORMAL and a VPC can create two DCGs, the one is NAT type and the other is non-NAT type.
    Name string
    Name of the DCG.
    NetworkInstanceId string
    If the network_type value is VPC, the available value is VPC ID. But when the network_type value is CCN, the available value is CCN instance ID.
    NetworkType string
    Type of associated network. Valid value: VPC and CCN.
    CnnRouteType string
    Type of CCN route. Valid value: BGP and STATIC. The property is available when the DCG type is CCN gateway and BGP enabled.
    CreateTime string
    Creation time of resource.
    DcGatewayId string
    ID of the resource.
    EnableBgp bool
    Indicates whether the BGP is enabled.
    GatewayType string
    Type of the gateway. Valid value: NORMAL and NAT. Default is NORMAL. NOTES: CCN only supports NORMAL and a VPC can create two DCGs, the one is NAT type and the other is non-NAT type.
    Name string
    Name of the DCG.
    NetworkInstanceId string
    If the network_type value is VPC, the available value is VPC ID. But when the network_type value is CCN, the available value is CCN instance ID.
    NetworkType string
    Type of associated network. Valid value: VPC and CCN.
    cnnRouteType String
    Type of CCN route. Valid value: BGP and STATIC. The property is available when the DCG type is CCN gateway and BGP enabled.
    createTime String
    Creation time of resource.
    dcGatewayId String
    ID of the resource.
    enableBgp Boolean
    Indicates whether the BGP is enabled.
    gatewayType String
    Type of the gateway. Valid value: NORMAL and NAT. Default is NORMAL. NOTES: CCN only supports NORMAL and a VPC can create two DCGs, the one is NAT type and the other is non-NAT type.
    name String
    Name of the DCG.
    networkInstanceId String
    If the network_type value is VPC, the available value is VPC ID. But when the network_type value is CCN, the available value is CCN instance ID.
    networkType String
    Type of associated network. Valid value: VPC and CCN.
    cnnRouteType string
    Type of CCN route. Valid value: BGP and STATIC. The property is available when the DCG type is CCN gateway and BGP enabled.
    createTime string
    Creation time of resource.
    dcGatewayId string
    ID of the resource.
    enableBgp boolean
    Indicates whether the BGP is enabled.
    gatewayType string
    Type of the gateway. Valid value: NORMAL and NAT. Default is NORMAL. NOTES: CCN only supports NORMAL and a VPC can create two DCGs, the one is NAT type and the other is non-NAT type.
    name string
    Name of the DCG.
    networkInstanceId string
    If the network_type value is VPC, the available value is VPC ID. But when the network_type value is CCN, the available value is CCN instance ID.
    networkType string
    Type of associated network. Valid value: VPC and CCN.
    cnn_route_type str
    Type of CCN route. Valid value: BGP and STATIC. The property is available when the DCG type is CCN gateway and BGP enabled.
    create_time str
    Creation time of resource.
    dc_gateway_id str
    ID of the resource.
    enable_bgp bool
    Indicates whether the BGP is enabled.
    gateway_type str
    Type of the gateway. Valid value: NORMAL and NAT. Default is NORMAL. NOTES: CCN only supports NORMAL and a VPC can create two DCGs, the one is NAT type and the other is non-NAT type.
    name str
    Name of the DCG.
    network_instance_id str
    If the network_type value is VPC, the available value is VPC ID. But when the network_type value is CCN, the available value is CCN instance ID.
    network_type str
    Type of associated network. Valid value: VPC and CCN.
    cnnRouteType String
    Type of CCN route. Valid value: BGP and STATIC. The property is available when the DCG type is CCN gateway and BGP enabled.
    createTime String
    Creation time of resource.
    dcGatewayId String
    ID of the resource.
    enableBgp Boolean
    Indicates whether the BGP is enabled.
    gatewayType String
    Type of the gateway. Valid value: NORMAL and NAT. Default is NORMAL. NOTES: CCN only supports NORMAL and a VPC can create two DCGs, the one is NAT type and the other is non-NAT type.
    name String
    Name of the DCG.
    networkInstanceId String
    If the network_type value is VPC, the available value is VPC ID. But when the network_type value is CCN, the available value is CCN instance ID.
    networkType String
    Type of associated network. Valid value: VPC and CCN.

    Import

    Direct connect gateway instance can be imported, e.g.

    $ pulumi import tencentcloud:index/dcGateway:DcGateway example dcg-dr1y0hu7
    

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

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack