tencentcloud.DcGateway
Explore with Pulumi AI
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:
- Network
Instance stringId - If the
network_type
value isVPC
, the available value is VPC ID. But when thenetwork_type
value isCCN
, the available value is CCN instance ID. - Network
Type string - Type of associated network. Valid value:
VPC
andCCN
. - Dc
Gateway stringId - ID of the resource.
- Gateway
Type string - Type of the gateway. Valid value:
NORMAL
andNAT
. Default isNORMAL
. NOTES: CCN only supportsNORMAL
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 stringId - If the
network_type
value isVPC
, the available value is VPC ID. But when thenetwork_type
value isCCN
, the available value is CCN instance ID. - Network
Type string - Type of associated network. Valid value:
VPC
andCCN
. - Dc
Gateway stringId - ID of the resource.
- Gateway
Type string - Type of the gateway. Valid value:
NORMAL
andNAT
. Default isNORMAL
. NOTES: CCN only supportsNORMAL
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 StringId - If the
network_type
value isVPC
, the available value is VPC ID. But when thenetwork_type
value isCCN
, the available value is CCN instance ID. - network
Type String - Type of associated network. Valid value:
VPC
andCCN
. - dc
Gateway StringId - ID of the resource.
- gateway
Type String - Type of the gateway. Valid value:
NORMAL
andNAT
. Default isNORMAL
. NOTES: CCN only supportsNORMAL
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 stringId - If the
network_type
value isVPC
, the available value is VPC ID. But when thenetwork_type
value isCCN
, the available value is CCN instance ID. - network
Type string - Type of associated network. Valid value:
VPC
andCCN
. - dc
Gateway stringId - ID of the resource.
- gateway
Type string - Type of the gateway. Valid value:
NORMAL
andNAT
. Default isNORMAL
. NOTES: CCN only supportsNORMAL
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_ strid - If the
network_type
value isVPC
, the available value is VPC ID. But when thenetwork_type
value isCCN
, the available value is CCN instance ID. - network_
type str - Type of associated network. Valid value:
VPC
andCCN
. - dc_
gateway_ strid - ID of the resource.
- gateway_
type str - Type of the gateway. Valid value:
NORMAL
andNAT
. Default isNORMAL
. NOTES: CCN only supportsNORMAL
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 StringId - If the
network_type
value isVPC
, the available value is VPC ID. But when thenetwork_type
value isCCN
, the available value is CCN instance ID. - network
Type String - Type of associated network. Valid value:
VPC
andCCN
. - dc
Gateway StringId - ID of the resource.
- gateway
Type String - Type of the gateway. Valid value:
NORMAL
andNAT
. Default isNORMAL
. NOTES: CCN only supportsNORMAL
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:
- Cnn
Route stringType - Type of CCN route. Valid value:
BGP
andSTATIC
. The property is available when the DCG type is CCN gateway and BGP enabled. - Create
Time string - Creation time of resource.
- Enable
Bgp bool - Indicates whether the BGP is enabled.
- Id string
- The provider-assigned unique ID for this managed resource.
- Cnn
Route stringType - Type of CCN route. Valid value:
BGP
andSTATIC
. The property is available when the DCG type is CCN gateway and BGP enabled. - Create
Time string - Creation time of resource.
- Enable
Bgp bool - Indicates whether the BGP is enabled.
- Id string
- The provider-assigned unique ID for this managed resource.
- cnn
Route StringType - Type of CCN route. Valid value:
BGP
andSTATIC
. The property is available when the DCG type is CCN gateway and BGP enabled. - create
Time String - Creation time of resource.
- enable
Bgp Boolean - Indicates whether the BGP is enabled.
- id String
- The provider-assigned unique ID for this managed resource.
- cnn
Route stringType - Type of CCN route. Valid value:
BGP
andSTATIC
. The property is available when the DCG type is CCN gateway and BGP enabled. - create
Time string - Creation time of resource.
- enable
Bgp boolean - Indicates whether the BGP is enabled.
- id string
- The provider-assigned unique ID for this managed resource.
- cnn_
route_ strtype - Type of CCN route. Valid value:
BGP
andSTATIC
. 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.
- cnn
Route StringType - Type of CCN route. Valid value:
BGP
andSTATIC
. The property is available when the DCG type is CCN gateway and BGP enabled. - create
Time String - Creation time of resource.
- enable
Bgp 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.
- Cnn
Route stringType - Type of CCN route. Valid value:
BGP
andSTATIC
. The property is available when the DCG type is CCN gateway and BGP enabled. - Create
Time string - Creation time of resource.
- Dc
Gateway stringId - ID of the resource.
- Enable
Bgp bool - Indicates whether the BGP is enabled.
- Gateway
Type string - Type of the gateway. Valid value:
NORMAL
andNAT
. Default isNORMAL
. NOTES: CCN only supportsNORMAL
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 stringId - If the
network_type
value isVPC
, the available value is VPC ID. But when thenetwork_type
value isCCN
, the available value is CCN instance ID. - Network
Type string - Type of associated network. Valid value:
VPC
andCCN
.
- Cnn
Route stringType - Type of CCN route. Valid value:
BGP
andSTATIC
. The property is available when the DCG type is CCN gateway and BGP enabled. - Create
Time string - Creation time of resource.
- Dc
Gateway stringId - ID of the resource.
- Enable
Bgp bool - Indicates whether the BGP is enabled.
- Gateway
Type string - Type of the gateway. Valid value:
NORMAL
andNAT
. Default isNORMAL
. NOTES: CCN only supportsNORMAL
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 stringId - If the
network_type
value isVPC
, the available value is VPC ID. But when thenetwork_type
value isCCN
, the available value is CCN instance ID. - Network
Type string - Type of associated network. Valid value:
VPC
andCCN
.
- cnn
Route StringType - Type of CCN route. Valid value:
BGP
andSTATIC
. The property is available when the DCG type is CCN gateway and BGP enabled. - create
Time String - Creation time of resource.
- dc
Gateway StringId - ID of the resource.
- enable
Bgp Boolean - Indicates whether the BGP is enabled.
- gateway
Type String - Type of the gateway. Valid value:
NORMAL
andNAT
. Default isNORMAL
. NOTES: CCN only supportsNORMAL
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 StringId - If the
network_type
value isVPC
, the available value is VPC ID. But when thenetwork_type
value isCCN
, the available value is CCN instance ID. - network
Type String - Type of associated network. Valid value:
VPC
andCCN
.
- cnn
Route stringType - Type of CCN route. Valid value:
BGP
andSTATIC
. The property is available when the DCG type is CCN gateway and BGP enabled. - create
Time string - Creation time of resource.
- dc
Gateway stringId - ID of the resource.
- enable
Bgp boolean - Indicates whether the BGP is enabled.
- gateway
Type string - Type of the gateway. Valid value:
NORMAL
andNAT
. Default isNORMAL
. NOTES: CCN only supportsNORMAL
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 stringId - If the
network_type
value isVPC
, the available value is VPC ID. But when thenetwork_type
value isCCN
, the available value is CCN instance ID. - network
Type string - Type of associated network. Valid value:
VPC
andCCN
.
- cnn_
route_ strtype - Type of CCN route. Valid value:
BGP
andSTATIC
. The property is available when the DCG type is CCN gateway and BGP enabled. - create_
time str - Creation time of resource.
- dc_
gateway_ strid - ID of the resource.
- enable_
bgp bool - Indicates whether the BGP is enabled.
- gateway_
type str - Type of the gateway. Valid value:
NORMAL
andNAT
. Default isNORMAL
. NOTES: CCN only supportsNORMAL
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_ strid - If the
network_type
value isVPC
, the available value is VPC ID. But when thenetwork_type
value isCCN
, the available value is CCN instance ID. - network_
type str - Type of associated network. Valid value:
VPC
andCCN
.
- cnn
Route StringType - Type of CCN route. Valid value:
BGP
andSTATIC
. The property is available when the DCG type is CCN gateway and BGP enabled. - create
Time String - Creation time of resource.
- dc
Gateway StringId - ID of the resource.
- enable
Bgp Boolean - Indicates whether the BGP is enabled.
- gateway
Type String - Type of the gateway. Valid value:
NORMAL
andNAT
. Default isNORMAL
. NOTES: CCN only supportsNORMAL
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 StringId - If the
network_type
value isVPC
, the available value is VPC ID. But when thenetwork_type
value isCCN
, the available value is CCN instance ID. - network
Type String - Type of associated network. Valid value:
VPC
andCCN
.
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.