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

tencentcloud.RouteEntry

Explore with Pulumi AI

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

    Provides a resource to create a routing entry in a VPC routing table.

    NOTE: It has been deprecated and replaced by tencentcloud_route_table_entry.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const main = new tencentcloud.Vpc("main", {cidrBlock: "10.4.0.0/16"});
    const routeTable = new tencentcloud.RouteTable("routeTable", {vpcId: main.vpcId});
    const rtbEntryInstanceRouteEntry = new tencentcloud.RouteEntry("rtbEntryInstanceRouteEntry", {
        vpcId: tencentcloud_route_table.main.vpc_id,
        routeTableId: routeTable.routeTableId,
        cidrBlock: "10.4.8.0/24",
        nextType: "instance",
        nextHub: "10.16.1.7",
    });
    const rtbEntryInstanceIndex_routeEntryRouteEntry = new tencentcloud.RouteEntry("rtbEntryInstanceIndex/routeEntryRouteEntry", {
        vpcId: tencentcloud_route_table.main.vpc_id,
        routeTableId: routeTable.routeTableId,
        cidrBlock: "10.4.5.0/24",
        nextType: "vpn_gateway",
        nextHub: "vpngw-db52irtl",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    main = tencentcloud.Vpc("main", cidr_block="10.4.0.0/16")
    route_table = tencentcloud.RouteTable("routeTable", vpc_id=main.vpc_id)
    rtb_entry_instance_route_entry = tencentcloud.RouteEntry("rtbEntryInstanceRouteEntry",
        vpc_id=tencentcloud_route_table["main"]["vpc_id"],
        route_table_id=route_table.route_table_id,
        cidr_block="10.4.8.0/24",
        next_type="instance",
        next_hub="10.16.1.7")
    rtb_entry_instance_index_route_entry_route_entry = tencentcloud.RouteEntry("rtbEntryInstanceIndex/routeEntryRouteEntry",
        vpc_id=tencentcloud_route_table["main"]["vpc_id"],
        route_table_id=route_table.route_table_id,
        cidr_block="10.4.5.0/24",
        next_type="vpn_gateway",
        next_hub="vpngw-db52irtl")
    
    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 {
    		main, err := tencentcloud.NewVpc(ctx, "main", &tencentcloud.VpcArgs{
    			CidrBlock: pulumi.String("10.4.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		routeTable, err := tencentcloud.NewRouteTable(ctx, "routeTable", &tencentcloud.RouteTableArgs{
    			VpcId: main.VpcId,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewRouteEntry(ctx, "rtbEntryInstanceRouteEntry", &tencentcloud.RouteEntryArgs{
    			VpcId:        pulumi.Any(tencentcloud_route_table.Main.Vpc_id),
    			RouteTableId: routeTable.RouteTableId,
    			CidrBlock:    pulumi.String("10.4.8.0/24"),
    			NextType:     pulumi.String("instance"),
    			NextHub:      pulumi.String("10.16.1.7"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewRouteEntry(ctx, "rtbEntryInstanceIndex/routeEntryRouteEntry", &tencentcloud.RouteEntryArgs{
    			VpcId:        pulumi.Any(tencentcloud_route_table.Main.Vpc_id),
    			RouteTableId: routeTable.RouteTableId,
    			CidrBlock:    pulumi.String("10.4.5.0/24"),
    			NextType:     pulumi.String("vpn_gateway"),
    			NextHub:      pulumi.String("vpngw-db52irtl"),
    		})
    		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 main = new Tencentcloud.Vpc("main", new()
        {
            CidrBlock = "10.4.0.0/16",
        });
    
        var routeTable = new Tencentcloud.RouteTable("routeTable", new()
        {
            VpcId = main.VpcId,
        });
    
        var rtbEntryInstanceRouteEntry = new Tencentcloud.RouteEntry("rtbEntryInstanceRouteEntry", new()
        {
            VpcId = tencentcloud_route_table.Main.Vpc_id,
            RouteTableId = routeTable.RouteTableId,
            CidrBlock = "10.4.8.0/24",
            NextType = "instance",
            NextHub = "10.16.1.7",
        });
    
        var rtbEntryInstanceIndex_routeEntryRouteEntry = new Tencentcloud.RouteEntry("rtbEntryInstanceIndex/routeEntryRouteEntry", new()
        {
            VpcId = tencentcloud_route_table.Main.Vpc_id,
            RouteTableId = routeTable.RouteTableId,
            CidrBlock = "10.4.5.0/24",
            NextType = "vpn_gateway",
            NextHub = "vpngw-db52irtl",
        });
    
    });
    
    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.RouteTable;
    import com.pulumi.tencentcloud.RouteTableArgs;
    import com.pulumi.tencentcloud.RouteEntry;
    import com.pulumi.tencentcloud.RouteEntryArgs;
    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 main = new Vpc("main", VpcArgs.builder()
                .cidrBlock("10.4.0.0/16")
                .build());
    
            var routeTable = new RouteTable("routeTable", RouteTableArgs.builder()
                .vpcId(main.vpcId())
                .build());
    
            var rtbEntryInstanceRouteEntry = new RouteEntry("rtbEntryInstanceRouteEntry", RouteEntryArgs.builder()
                .vpcId(tencentcloud_route_table.main().vpc_id())
                .routeTableId(routeTable.routeTableId())
                .cidrBlock("10.4.8.0/24")
                .nextType("instance")
                .nextHub("10.16.1.7")
                .build());
    
            var rtbEntryInstanceIndex_routeEntryRouteEntry = new RouteEntry("rtbEntryInstanceIndex/routeEntryRouteEntry", RouteEntryArgs.builder()
                .vpcId(tencentcloud_route_table.main().vpc_id())
                .routeTableId(routeTable.routeTableId())
                .cidrBlock("10.4.5.0/24")
                .nextType("vpn_gateway")
                .nextHub("vpngw-db52irtl")
                .build());
    
        }
    }
    
    resources:
      main:
        type: tencentcloud:Vpc
        properties:
          cidrBlock: 10.4.0.0/16
      routeTable:
        type: tencentcloud:RouteTable
        properties:
          vpcId: ${main.vpcId}
      rtbEntryInstanceRouteEntry:
        type: tencentcloud:RouteEntry
        properties:
          vpcId: ${tencentcloud_route_table.main.vpc_id}
          routeTableId: ${routeTable.routeTableId}
          cidrBlock: 10.4.8.0/24
          nextType: instance
          nextHub: 10.16.1.7
      rtbEntryInstanceIndex/routeEntryRouteEntry:
        type: tencentcloud:RouteEntry
        properties:
          vpcId: ${tencentcloud_route_table.main.vpc_id}
          routeTableId: ${routeTable.routeTableId}
          cidrBlock: 10.4.5.0/24
          nextType: vpn_gateway
          nextHub: vpngw-db52irtl
    

    Create RouteEntry Resource

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

    Constructor syntax

    new RouteEntry(name: string, args: RouteEntryArgs, opts?: CustomResourceOptions);
    @overload
    def RouteEntry(resource_name: str,
                   args: RouteEntryArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def RouteEntry(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   cidr_block: Optional[str] = None,
                   next_hub: Optional[str] = None,
                   next_type: Optional[str] = None,
                   route_table_id: Optional[str] = None,
                   vpc_id: Optional[str] = None,
                   route_entry_id: Optional[str] = None)
    func NewRouteEntry(ctx *Context, name string, args RouteEntryArgs, opts ...ResourceOption) (*RouteEntry, error)
    public RouteEntry(string name, RouteEntryArgs args, CustomResourceOptions? opts = null)
    public RouteEntry(String name, RouteEntryArgs args)
    public RouteEntry(String name, RouteEntryArgs args, CustomResourceOptions options)
    
    type: tencentcloud:RouteEntry
    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 RouteEntryArgs
    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 RouteEntryArgs
    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 RouteEntryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RouteEntryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RouteEntryArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    CidrBlock string
    The RouteEntry's target network segment.
    NextHub string
    The route entry's next hub. CVM instance ID or VPC router interface ID.
    NextType string
    The next hop type. Valid values: public_gateway,vpn_gateway,sslvpn_gateway,dc_gateway,peering_connection,nat_gateway,havip,local_gateway, intranat, user_ccn and instance. instance points to CVM Instance.
    RouteTableId string
    The ID of the route table.
    VpcId string
    The VPC ID.
    RouteEntryId string
    ID of the resource.
    CidrBlock string
    The RouteEntry's target network segment.
    NextHub string
    The route entry's next hub. CVM instance ID or VPC router interface ID.
    NextType string
    The next hop type. Valid values: public_gateway,vpn_gateway,sslvpn_gateway,dc_gateway,peering_connection,nat_gateway,havip,local_gateway, intranat, user_ccn and instance. instance points to CVM Instance.
    RouteTableId string
    The ID of the route table.
    VpcId string
    The VPC ID.
    RouteEntryId string
    ID of the resource.
    cidrBlock String
    The RouteEntry's target network segment.
    nextHub String
    The route entry's next hub. CVM instance ID or VPC router interface ID.
    nextType String
    The next hop type. Valid values: public_gateway,vpn_gateway,sslvpn_gateway,dc_gateway,peering_connection,nat_gateway,havip,local_gateway, intranat, user_ccn and instance. instance points to CVM Instance.
    routeTableId String
    The ID of the route table.
    vpcId String
    The VPC ID.
    routeEntryId String
    ID of the resource.
    cidrBlock string
    The RouteEntry's target network segment.
    nextHub string
    The route entry's next hub. CVM instance ID or VPC router interface ID.
    nextType string
    The next hop type. Valid values: public_gateway,vpn_gateway,sslvpn_gateway,dc_gateway,peering_connection,nat_gateway,havip,local_gateway, intranat, user_ccn and instance. instance points to CVM Instance.
    routeTableId string
    The ID of the route table.
    vpcId string
    The VPC ID.
    routeEntryId string
    ID of the resource.
    cidr_block str
    The RouteEntry's target network segment.
    next_hub str
    The route entry's next hub. CVM instance ID or VPC router interface ID.
    next_type str
    The next hop type. Valid values: public_gateway,vpn_gateway,sslvpn_gateway,dc_gateway,peering_connection,nat_gateway,havip,local_gateway, intranat, user_ccn and instance. instance points to CVM Instance.
    route_table_id str
    The ID of the route table.
    vpc_id str
    The VPC ID.
    route_entry_id str
    ID of the resource.
    cidrBlock String
    The RouteEntry's target network segment.
    nextHub String
    The route entry's next hub. CVM instance ID or VPC router interface ID.
    nextType String
    The next hop type. Valid values: public_gateway,vpn_gateway,sslvpn_gateway,dc_gateway,peering_connection,nat_gateway,havip,local_gateway, intranat, user_ccn and instance. instance points to CVM Instance.
    routeTableId String
    The ID of the route table.
    vpcId String
    The VPC ID.
    routeEntryId String
    ID of the resource.

    Outputs

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

    Get an existing RouteEntry 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?: RouteEntryState, opts?: CustomResourceOptions): RouteEntry
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cidr_block: Optional[str] = None,
            next_hub: Optional[str] = None,
            next_type: Optional[str] = None,
            route_entry_id: Optional[str] = None,
            route_table_id: Optional[str] = None,
            vpc_id: Optional[str] = None) -> RouteEntry
    func GetRouteEntry(ctx *Context, name string, id IDInput, state *RouteEntryState, opts ...ResourceOption) (*RouteEntry, error)
    public static RouteEntry Get(string name, Input<string> id, RouteEntryState? state, CustomResourceOptions? opts = null)
    public static RouteEntry get(String name, Output<String> id, RouteEntryState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:RouteEntry    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:
    CidrBlock string
    The RouteEntry's target network segment.
    NextHub string
    The route entry's next hub. CVM instance ID or VPC router interface ID.
    NextType string
    The next hop type. Valid values: public_gateway,vpn_gateway,sslvpn_gateway,dc_gateway,peering_connection,nat_gateway,havip,local_gateway, intranat, user_ccn and instance. instance points to CVM Instance.
    RouteEntryId string
    ID of the resource.
    RouteTableId string
    The ID of the route table.
    VpcId string
    The VPC ID.
    CidrBlock string
    The RouteEntry's target network segment.
    NextHub string
    The route entry's next hub. CVM instance ID or VPC router interface ID.
    NextType string
    The next hop type. Valid values: public_gateway,vpn_gateway,sslvpn_gateway,dc_gateway,peering_connection,nat_gateway,havip,local_gateway, intranat, user_ccn and instance. instance points to CVM Instance.
    RouteEntryId string
    ID of the resource.
    RouteTableId string
    The ID of the route table.
    VpcId string
    The VPC ID.
    cidrBlock String
    The RouteEntry's target network segment.
    nextHub String
    The route entry's next hub. CVM instance ID or VPC router interface ID.
    nextType String
    The next hop type. Valid values: public_gateway,vpn_gateway,sslvpn_gateway,dc_gateway,peering_connection,nat_gateway,havip,local_gateway, intranat, user_ccn and instance. instance points to CVM Instance.
    routeEntryId String
    ID of the resource.
    routeTableId String
    The ID of the route table.
    vpcId String
    The VPC ID.
    cidrBlock string
    The RouteEntry's target network segment.
    nextHub string
    The route entry's next hub. CVM instance ID or VPC router interface ID.
    nextType string
    The next hop type. Valid values: public_gateway,vpn_gateway,sslvpn_gateway,dc_gateway,peering_connection,nat_gateway,havip,local_gateway, intranat, user_ccn and instance. instance points to CVM Instance.
    routeEntryId string
    ID of the resource.
    routeTableId string
    The ID of the route table.
    vpcId string
    The VPC ID.
    cidr_block str
    The RouteEntry's target network segment.
    next_hub str
    The route entry's next hub. CVM instance ID or VPC router interface ID.
    next_type str
    The next hop type. Valid values: public_gateway,vpn_gateway,sslvpn_gateway,dc_gateway,peering_connection,nat_gateway,havip,local_gateway, intranat, user_ccn and instance. instance points to CVM Instance.
    route_entry_id str
    ID of the resource.
    route_table_id str
    The ID of the route table.
    vpc_id str
    The VPC ID.
    cidrBlock String
    The RouteEntry's target network segment.
    nextHub String
    The route entry's next hub. CVM instance ID or VPC router interface ID.
    nextType String
    The next hop type. Valid values: public_gateway,vpn_gateway,sslvpn_gateway,dc_gateway,peering_connection,nat_gateway,havip,local_gateway, intranat, user_ccn and instance. instance points to CVM Instance.
    routeEntryId String
    ID of the resource.
    routeTableId String
    The ID of the route table.
    vpcId String
    The VPC ID.

    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