1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. VpcLocalGateway
tencentcloud 1.81.187 published on Monday, Apr 28, 2025 by tencentcloudstack

tencentcloud.VpcLocalGateway

Explore with Pulumi AI

Provides a resource to create a vpc local_gateway

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
const example = new tencentcloud.VpcLocalGateway("example", {
    localGatewayName: "tf-example",
    vpcId: vpc.vpcId,
    cdcId: "cluster-j9gyu1iy",
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
example = tencentcloud.VpcLocalGateway("example",
    local_gateway_name="tf-example",
    vpc_id=vpc.vpc_id,
    cdc_id="cluster-j9gyu1iy")
Copy
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 {
		vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
			CidrBlock: pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		_, err = tencentcloud.NewVpcLocalGateway(ctx, "example", &tencentcloud.VpcLocalGatewayArgs{
			LocalGatewayName: pulumi.String("tf-example"),
			VpcId:            vpc.VpcId,
			CdcId:            pulumi.String("cluster-j9gyu1iy"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var vpc = new Tencentcloud.Vpc("vpc", new()
    {
        CidrBlock = "10.0.0.0/16",
    });

    var example = new Tencentcloud.VpcLocalGateway("example", new()
    {
        LocalGatewayName = "tf-example",
        VpcId = vpc.VpcId,
        CdcId = "cluster-j9gyu1iy",
    });

});
Copy
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.VpcLocalGateway;
import com.pulumi.tencentcloud.VpcLocalGatewayArgs;
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 vpc = new Vpc("vpc", VpcArgs.builder()
            .cidrBlock("10.0.0.0/16")
            .build());

        var example = new VpcLocalGateway("example", VpcLocalGatewayArgs.builder()
            .localGatewayName("tf-example")
            .vpcId(vpc.vpcId())
            .cdcId("cluster-j9gyu1iy")
            .build());

    }
}
Copy
resources:
  vpc:
    type: tencentcloud:Vpc
    properties:
      cidrBlock: 10.0.0.0/16
  example:
    type: tencentcloud:VpcLocalGateway
    properties:
      localGatewayName: tf-example
      vpcId: ${vpc.vpcId}
      cdcId: cluster-j9gyu1iy
Copy

Create VpcLocalGateway Resource

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

Constructor syntax

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

@overload
def VpcLocalGateway(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    cdc_id: Optional[str] = None,
                    local_gateway_name: Optional[str] = None,
                    vpc_id: Optional[str] = None,
                    vpc_local_gateway_id: Optional[str] = None)
func NewVpcLocalGateway(ctx *Context, name string, args VpcLocalGatewayArgs, opts ...ResourceOption) (*VpcLocalGateway, error)
public VpcLocalGateway(string name, VpcLocalGatewayArgs args, CustomResourceOptions? opts = null)
public VpcLocalGateway(String name, VpcLocalGatewayArgs args)
public VpcLocalGateway(String name, VpcLocalGatewayArgs args, CustomResourceOptions options)
type: tencentcloud:VpcLocalGateway
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. VpcLocalGatewayArgs
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. VpcLocalGatewayArgs
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. VpcLocalGatewayArgs
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. VpcLocalGatewayArgs
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. VpcLocalGatewayArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

CdcId This property is required. string
CDC instance ID.
LocalGatewayName This property is required. string
Local gateway name.
VpcId This property is required. string
VPC instance ID.
VpcLocalGatewayId string
ID of the resource.
CdcId This property is required. string
CDC instance ID.
LocalGatewayName This property is required. string
Local gateway name.
VpcId This property is required. string
VPC instance ID.
VpcLocalGatewayId string
ID of the resource.
cdcId This property is required. String
CDC instance ID.
localGatewayName This property is required. String
Local gateway name.
vpcId This property is required. String
VPC instance ID.
vpcLocalGatewayId String
ID of the resource.
cdcId This property is required. string
CDC instance ID.
localGatewayName This property is required. string
Local gateway name.
vpcId This property is required. string
VPC instance ID.
vpcLocalGatewayId string
ID of the resource.
cdc_id This property is required. str
CDC instance ID.
local_gateway_name This property is required. str
Local gateway name.
vpc_id This property is required. str
VPC instance ID.
vpc_local_gateway_id str
ID of the resource.
cdcId This property is required. String
CDC instance ID.
localGatewayName This property is required. String
Local gateway name.
vpcId This property is required. String
VPC instance ID.
vpcLocalGatewayId String
ID of the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the VpcLocalGateway 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 VpcLocalGateway Resource

Get an existing VpcLocalGateway 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?: VpcLocalGatewayState, opts?: CustomResourceOptions): VpcLocalGateway
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cdc_id: Optional[str] = None,
        local_gateway_name: Optional[str] = None,
        vpc_id: Optional[str] = None,
        vpc_local_gateway_id: Optional[str] = None) -> VpcLocalGateway
func GetVpcLocalGateway(ctx *Context, name string, id IDInput, state *VpcLocalGatewayState, opts ...ResourceOption) (*VpcLocalGateway, error)
public static VpcLocalGateway Get(string name, Input<string> id, VpcLocalGatewayState? state, CustomResourceOptions? opts = null)
public static VpcLocalGateway get(String name, Output<String> id, VpcLocalGatewayState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:VpcLocalGateway    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:
CdcId string
CDC instance ID.
LocalGatewayName string
Local gateway name.
VpcId string
VPC instance ID.
VpcLocalGatewayId string
ID of the resource.
CdcId string
CDC instance ID.
LocalGatewayName string
Local gateway name.
VpcId string
VPC instance ID.
VpcLocalGatewayId string
ID of the resource.
cdcId String
CDC instance ID.
localGatewayName String
Local gateway name.
vpcId String
VPC instance ID.
vpcLocalGatewayId String
ID of the resource.
cdcId string
CDC instance ID.
localGatewayName string
Local gateway name.
vpcId string
VPC instance ID.
vpcLocalGatewayId string
ID of the resource.
cdc_id str
CDC instance ID.
local_gateway_name str
Local gateway name.
vpc_id str
VPC instance ID.
vpc_local_gateway_id str
ID of the resource.
cdcId String
CDC instance ID.
localGatewayName String
Local gateway name.
vpcId String
VPC instance ID.
vpcLocalGatewayId String
ID of the resource.

Import

vpc local_gateway can be imported using the id, e.g.

$ pulumi import tencentcloud:index/vpcLocalGateway:VpcLocalGateway local_gateway local_gateway_id
Copy

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.