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

tencentcloud.VpnGatewayRoute

Explore with Pulumi AI

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

    Provides a resource to create a VPN gateway route.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const route = new tencentcloud.VpnGatewayRoute("route", {
        destinationCidrBlock: "10.0.0.0/16",
        instanceId: "vpnx-5b5dmao3",
        instanceType: "VPNCONN",
        priority: 100,
        status: "DISABLE",
        vpnGatewayId: "vpngw-ak9sjem2",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    route = tencentcloud.VpnGatewayRoute("route",
        destination_cidr_block="10.0.0.0/16",
        instance_id="vpnx-5b5dmao3",
        instance_type="VPNCONN",
        priority=100,
        status="DISABLE",
        vpn_gateway_id="vpngw-ak9sjem2")
    
    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 {
    		_, err := tencentcloud.NewVpnGatewayRoute(ctx, "route", &tencentcloud.VpnGatewayRouteArgs{
    			DestinationCidrBlock: pulumi.String("10.0.0.0/16"),
    			InstanceId:           pulumi.String("vpnx-5b5dmao3"),
    			InstanceType:         pulumi.String("VPNCONN"),
    			Priority:             pulumi.Float64(100),
    			Status:               pulumi.String("DISABLE"),
    			VpnGatewayId:         pulumi.String("vpngw-ak9sjem2"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var route = new Tencentcloud.VpnGatewayRoute("route", new()
        {
            DestinationCidrBlock = "10.0.0.0/16",
            InstanceId = "vpnx-5b5dmao3",
            InstanceType = "VPNCONN",
            Priority = 100,
            Status = "DISABLE",
            VpnGatewayId = "vpngw-ak9sjem2",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.VpnGatewayRoute;
    import com.pulumi.tencentcloud.VpnGatewayRouteArgs;
    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 route = new VpnGatewayRoute("route", VpnGatewayRouteArgs.builder()
                .destinationCidrBlock("10.0.0.0/16")
                .instanceId("vpnx-5b5dmao3")
                .instanceType("VPNCONN")
                .priority(100)
                .status("DISABLE")
                .vpnGatewayId("vpngw-ak9sjem2")
                .build());
    
        }
    }
    
    resources:
      route:
        type: tencentcloud:VpnGatewayRoute
        properties:
          destinationCidrBlock: 10.0.0.0/16
          instanceId: vpnx-5b5dmao3
          instanceType: VPNCONN
          priority: 100
          status: DISABLE
          vpnGatewayId: vpngw-ak9sjem2
    

    Create VpnGatewayRoute Resource

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

    Constructor syntax

    new VpnGatewayRoute(name: string, args: VpnGatewayRouteArgs, opts?: CustomResourceOptions);
    @overload
    def VpnGatewayRoute(resource_name: str,
                        args: VpnGatewayRouteArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpnGatewayRoute(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        destination_cidr_block: Optional[str] = None,
                        instance_id: Optional[str] = None,
                        instance_type: Optional[str] = None,
                        priority: Optional[float] = None,
                        status: Optional[str] = None,
                        vpn_gateway_id: Optional[str] = None,
                        vpn_gateway_route_id: Optional[str] = None)
    func NewVpnGatewayRoute(ctx *Context, name string, args VpnGatewayRouteArgs, opts ...ResourceOption) (*VpnGatewayRoute, error)
    public VpnGatewayRoute(string name, VpnGatewayRouteArgs args, CustomResourceOptions? opts = null)
    public VpnGatewayRoute(String name, VpnGatewayRouteArgs args)
    public VpnGatewayRoute(String name, VpnGatewayRouteArgs args, CustomResourceOptions options)
    
    type: tencentcloud:VpnGatewayRoute
    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 VpnGatewayRouteArgs
    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 VpnGatewayRouteArgs
    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 VpnGatewayRouteArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpnGatewayRouteArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpnGatewayRouteArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    DestinationCidrBlock string
    Destination IDC IP range.
    InstanceId string
    Instance ID of the next hop.
    InstanceType string
    Next hop type (type of the associated instance). Valid values: VPNCONN (VPN tunnel) and CCN (CCN instance).
    Priority double
    Priority. Valid values: 0 and 100.
    Status string
    Status. Valid values: ENABLE and DISABLE.
    VpnGatewayId string
    VPN gateway ID.
    VpnGatewayRouteId string
    ID of the resource.
    DestinationCidrBlock string
    Destination IDC IP range.
    InstanceId string
    Instance ID of the next hop.
    InstanceType string
    Next hop type (type of the associated instance). Valid values: VPNCONN (VPN tunnel) and CCN (CCN instance).
    Priority float64
    Priority. Valid values: 0 and 100.
    Status string
    Status. Valid values: ENABLE and DISABLE.
    VpnGatewayId string
    VPN gateway ID.
    VpnGatewayRouteId string
    ID of the resource.
    destinationCidrBlock String
    Destination IDC IP range.
    instanceId String
    Instance ID of the next hop.
    instanceType String
    Next hop type (type of the associated instance). Valid values: VPNCONN (VPN tunnel) and CCN (CCN instance).
    priority Double
    Priority. Valid values: 0 and 100.
    status String
    Status. Valid values: ENABLE and DISABLE.
    vpnGatewayId String
    VPN gateway ID.
    vpnGatewayRouteId String
    ID of the resource.
    destinationCidrBlock string
    Destination IDC IP range.
    instanceId string
    Instance ID of the next hop.
    instanceType string
    Next hop type (type of the associated instance). Valid values: VPNCONN (VPN tunnel) and CCN (CCN instance).
    priority number
    Priority. Valid values: 0 and 100.
    status string
    Status. Valid values: ENABLE and DISABLE.
    vpnGatewayId string
    VPN gateway ID.
    vpnGatewayRouteId string
    ID of the resource.
    destination_cidr_block str
    Destination IDC IP range.
    instance_id str
    Instance ID of the next hop.
    instance_type str
    Next hop type (type of the associated instance). Valid values: VPNCONN (VPN tunnel) and CCN (CCN instance).
    priority float
    Priority. Valid values: 0 and 100.
    status str
    Status. Valid values: ENABLE and DISABLE.
    vpn_gateway_id str
    VPN gateway ID.
    vpn_gateway_route_id str
    ID of the resource.
    destinationCidrBlock String
    Destination IDC IP range.
    instanceId String
    Instance ID of the next hop.
    instanceType String
    Next hop type (type of the associated instance). Valid values: VPNCONN (VPN tunnel) and CCN (CCN instance).
    priority Number
    Priority. Valid values: 0 and 100.
    status String
    Status. Valid values: ENABLE and DISABLE.
    vpnGatewayId String
    VPN gateway ID.
    vpnGatewayRouteId String
    ID of the resource.

    Outputs

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

    CreateTime string
    Create time.
    Id string
    The provider-assigned unique ID for this managed resource.
    RouteId string
    Route ID.
    Type string
    Route type. Default value: Static.
    UpdateTime string
    Update time.
    CreateTime string
    Create time.
    Id string
    The provider-assigned unique ID for this managed resource.
    RouteId string
    Route ID.
    Type string
    Route type. Default value: Static.
    UpdateTime string
    Update time.
    createTime String
    Create time.
    id String
    The provider-assigned unique ID for this managed resource.
    routeId String
    Route ID.
    type String
    Route type. Default value: Static.
    updateTime String
    Update time.
    createTime string
    Create time.
    id string
    The provider-assigned unique ID for this managed resource.
    routeId string
    Route ID.
    type string
    Route type. Default value: Static.
    updateTime string
    Update time.
    create_time str
    Create time.
    id str
    The provider-assigned unique ID for this managed resource.
    route_id str
    Route ID.
    type str
    Route type. Default value: Static.
    update_time str
    Update time.
    createTime String
    Create time.
    id String
    The provider-assigned unique ID for this managed resource.
    routeId String
    Route ID.
    type String
    Route type. Default value: Static.
    updateTime String
    Update time.

    Look up Existing VpnGatewayRoute Resource

    Get an existing VpnGatewayRoute 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?: VpnGatewayRouteState, opts?: CustomResourceOptions): VpnGatewayRoute
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            destination_cidr_block: Optional[str] = None,
            instance_id: Optional[str] = None,
            instance_type: Optional[str] = None,
            priority: Optional[float] = None,
            route_id: Optional[str] = None,
            status: Optional[str] = None,
            type: Optional[str] = None,
            update_time: Optional[str] = None,
            vpn_gateway_id: Optional[str] = None,
            vpn_gateway_route_id: Optional[str] = None) -> VpnGatewayRoute
    func GetVpnGatewayRoute(ctx *Context, name string, id IDInput, state *VpnGatewayRouteState, opts ...ResourceOption) (*VpnGatewayRoute, error)
    public static VpnGatewayRoute Get(string name, Input<string> id, VpnGatewayRouteState? state, CustomResourceOptions? opts = null)
    public static VpnGatewayRoute get(String name, Output<String> id, VpnGatewayRouteState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:VpnGatewayRoute    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:
    CreateTime string
    Create time.
    DestinationCidrBlock string
    Destination IDC IP range.
    InstanceId string
    Instance ID of the next hop.
    InstanceType string
    Next hop type (type of the associated instance). Valid values: VPNCONN (VPN tunnel) and CCN (CCN instance).
    Priority double
    Priority. Valid values: 0 and 100.
    RouteId string
    Route ID.
    Status string
    Status. Valid values: ENABLE and DISABLE.
    Type string
    Route type. Default value: Static.
    UpdateTime string
    Update time.
    VpnGatewayId string
    VPN gateway ID.
    VpnGatewayRouteId string
    ID of the resource.
    CreateTime string
    Create time.
    DestinationCidrBlock string
    Destination IDC IP range.
    InstanceId string
    Instance ID of the next hop.
    InstanceType string
    Next hop type (type of the associated instance). Valid values: VPNCONN (VPN tunnel) and CCN (CCN instance).
    Priority float64
    Priority. Valid values: 0 and 100.
    RouteId string
    Route ID.
    Status string
    Status. Valid values: ENABLE and DISABLE.
    Type string
    Route type. Default value: Static.
    UpdateTime string
    Update time.
    VpnGatewayId string
    VPN gateway ID.
    VpnGatewayRouteId string
    ID of the resource.
    createTime String
    Create time.
    destinationCidrBlock String
    Destination IDC IP range.
    instanceId String
    Instance ID of the next hop.
    instanceType String
    Next hop type (type of the associated instance). Valid values: VPNCONN (VPN tunnel) and CCN (CCN instance).
    priority Double
    Priority. Valid values: 0 and 100.
    routeId String
    Route ID.
    status String
    Status. Valid values: ENABLE and DISABLE.
    type String
    Route type. Default value: Static.
    updateTime String
    Update time.
    vpnGatewayId String
    VPN gateway ID.
    vpnGatewayRouteId String
    ID of the resource.
    createTime string
    Create time.
    destinationCidrBlock string
    Destination IDC IP range.
    instanceId string
    Instance ID of the next hop.
    instanceType string
    Next hop type (type of the associated instance). Valid values: VPNCONN (VPN tunnel) and CCN (CCN instance).
    priority number
    Priority. Valid values: 0 and 100.
    routeId string
    Route ID.
    status string
    Status. Valid values: ENABLE and DISABLE.
    type string
    Route type. Default value: Static.
    updateTime string
    Update time.
    vpnGatewayId string
    VPN gateway ID.
    vpnGatewayRouteId string
    ID of the resource.
    create_time str
    Create time.
    destination_cidr_block str
    Destination IDC IP range.
    instance_id str
    Instance ID of the next hop.
    instance_type str
    Next hop type (type of the associated instance). Valid values: VPNCONN (VPN tunnel) and CCN (CCN instance).
    priority float
    Priority. Valid values: 0 and 100.
    route_id str
    Route ID.
    status str
    Status. Valid values: ENABLE and DISABLE.
    type str
    Route type. Default value: Static.
    update_time str
    Update time.
    vpn_gateway_id str
    VPN gateway ID.
    vpn_gateway_route_id str
    ID of the resource.
    createTime String
    Create time.
    destinationCidrBlock String
    Destination IDC IP range.
    instanceId String
    Instance ID of the next hop.
    instanceType String
    Next hop type (type of the associated instance). Valid values: VPNCONN (VPN tunnel) and CCN (CCN instance).
    priority Number
    Priority. Valid values: 0 and 100.
    routeId String
    Route ID.
    status String
    Status. Valid values: ENABLE and DISABLE.
    type String
    Route type. Default value: Static.
    updateTime String
    Update time.
    vpnGatewayId String
    VPN gateway ID.
    vpnGatewayRouteId String
    ID of the resource.

    Import

    VPN gateway route can be imported using the id, the id format must be ‘{vpn_gateway_id}#{route_id}’, e.g.

    $ pulumi import tencentcloud:index/vpnGatewayRoute:VpnGatewayRoute route1 vpngw-ak9sjem2#vpngw-8ccsnclt
    

    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