1. Packages
  2. Flexibleengine Provider
  3. API Docs
  4. VpcRoute
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

flexibleengine.VpcRoute

Explore with Pulumi AI

flexibleengine logo
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

    Manages a VPC route resource within FlexibleEngine.

    Example Usage

    Add route to the default route table

    import * as pulumi from "@pulumi/pulumi";
    import * as flexibleengine from "@pulumi/flexibleengine";
    
    const config = new pulumi.Config();
    const nexthop = config.requireObject("nexthop");
    const exampleVpc = new flexibleengine.VpcV1("exampleVpc", {cidr: "192.168.0.0/16"});
    const vpcRoute = new flexibleengine.VpcRoute("vpcRoute", {
        vpcId: exampleVpc.vpcV1Id,
        destination: "192.168.0.0/16",
        type: "peering",
        nexthop: nexthop,
    });
    
    import pulumi
    import pulumi_flexibleengine as flexibleengine
    
    config = pulumi.Config()
    nexthop = config.require_object("nexthop")
    example_vpc = flexibleengine.VpcV1("exampleVpc", cidr="192.168.0.0/16")
    vpc_route = flexibleengine.VpcRoute("vpcRoute",
        vpc_id=example_vpc.vpc_v1_id,
        destination="192.168.0.0/16",
        type="peering",
        nexthop=nexthop)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		nexthop := cfg.RequireObject("nexthop")
    		exampleVpc, err := flexibleengine.NewVpcV1(ctx, "exampleVpc", &flexibleengine.VpcV1Args{
    			Cidr: pulumi.String("192.168.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = flexibleengine.NewVpcRoute(ctx, "vpcRoute", &flexibleengine.VpcRouteArgs{
    			VpcId:       exampleVpc.VpcV1Id,
    			Destination: pulumi.String("192.168.0.0/16"),
    			Type:        pulumi.String("peering"),
    			Nexthop:     pulumi.Any(nexthop),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Flexibleengine = Pulumi.Flexibleengine;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var nexthop = config.RequireObject<dynamic>("nexthop");
        var exampleVpc = new Flexibleengine.VpcV1("exampleVpc", new()
        {
            Cidr = "192.168.0.0/16",
        });
    
        var vpcRoute = new Flexibleengine.VpcRoute("vpcRoute", new()
        {
            VpcId = exampleVpc.VpcV1Id,
            Destination = "192.168.0.0/16",
            Type = "peering",
            Nexthop = nexthop,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.flexibleengine.VpcV1;
    import com.pulumi.flexibleengine.VpcV1Args;
    import com.pulumi.flexibleengine.VpcRoute;
    import com.pulumi.flexibleengine.VpcRouteArgs;
    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) {
            final var config = ctx.config();
            final var nexthop = config.get("nexthop");
            var exampleVpc = new VpcV1("exampleVpc", VpcV1Args.builder()
                .cidr("192.168.0.0/16")
                .build());
    
            var vpcRoute = new VpcRoute("vpcRoute", VpcRouteArgs.builder()
                .vpcId(exampleVpc.vpcV1Id())
                .destination("192.168.0.0/16")
                .type("peering")
                .nexthop(nexthop)
                .build());
    
        }
    }
    
    configuration:
      nexthop:
        type: dynamic
    resources:
      exampleVpc:
        type: flexibleengine:VpcV1
        properties:
          cidr: 192.168.0.0/16
      vpcRoute:
        type: flexibleengine:VpcRoute
        properties:
          vpcId: ${exampleVpc.vpcV1Id}
          destination: 192.168.0.0/16
          type: peering
          nexthop: ${nexthop}
    

    Add route to a custom route table

    import * as pulumi from "@pulumi/pulumi";
    import * as flexibleengine from "@pulumi/flexibleengine";
    
    const config = new pulumi.Config();
    const nexthop = config.requireObject("nexthop");
    const exampleVpc = new flexibleengine.VpcV1("exampleVpc", {cidr: "192.168.0.0/16"});
    const rtb = flexibleengine.getVpcRouteTableOutput({
        vpcId: exampleVpc.vpcV1Id,
        name: "demo",
    });
    const vpcRoute = new flexibleengine.VpcRoute("vpcRoute", {
        vpcId: exampleVpc.vpcV1Id,
        routeTableId: rtb.apply(rtb => rtb.id),
        destination: "172.16.8.0/24",
        type: "ecs",
        nexthop: nexthop,
    });
    
    import pulumi
    import pulumi_flexibleengine as flexibleengine
    
    config = pulumi.Config()
    nexthop = config.require_object("nexthop")
    example_vpc = flexibleengine.VpcV1("exampleVpc", cidr="192.168.0.0/16")
    rtb = flexibleengine.get_vpc_route_table_output(vpc_id=example_vpc.vpc_v1_id,
        name="demo")
    vpc_route = flexibleengine.VpcRoute("vpcRoute",
        vpc_id=example_vpc.vpc_v1_id,
        route_table_id=rtb.id,
        destination="172.16.8.0/24",
        type="ecs",
        nexthop=nexthop)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		nexthop := cfg.RequireObject("nexthop")
    		exampleVpc, err := flexibleengine.NewVpcV1(ctx, "exampleVpc", &flexibleengine.VpcV1Args{
    			Cidr: pulumi.String("192.168.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		rtb := flexibleengine.LookupVpcRouteTableOutput(ctx, flexibleengine.GetVpcRouteTableOutputArgs{
    			VpcId: exampleVpc.VpcV1Id,
    			Name:  pulumi.String("demo"),
    		}, nil)
    		_, err = flexibleengine.NewVpcRoute(ctx, "vpcRoute", &flexibleengine.VpcRouteArgs{
    			VpcId: exampleVpc.VpcV1Id,
    			RouteTableId: pulumi.String(rtb.ApplyT(func(rtb flexibleengine.GetVpcRouteTableResult) (*string, error) {
    				return &rtb.Id, nil
    			}).(pulumi.StringPtrOutput)),
    			Destination: pulumi.String("172.16.8.0/24"),
    			Type:        pulumi.String("ecs"),
    			Nexthop:     pulumi.Any(nexthop),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Flexibleengine = Pulumi.Flexibleengine;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var nexthop = config.RequireObject<dynamic>("nexthop");
        var exampleVpc = new Flexibleengine.VpcV1("exampleVpc", new()
        {
            Cidr = "192.168.0.0/16",
        });
    
        var rtb = Flexibleengine.GetVpcRouteTable.Invoke(new()
        {
            VpcId = exampleVpc.VpcV1Id,
            Name = "demo",
        });
    
        var vpcRoute = new Flexibleengine.VpcRoute("vpcRoute", new()
        {
            VpcId = exampleVpc.VpcV1Id,
            RouteTableId = rtb.Apply(getVpcRouteTableResult => getVpcRouteTableResult.Id),
            Destination = "172.16.8.0/24",
            Type = "ecs",
            Nexthop = nexthop,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.flexibleengine.VpcV1;
    import com.pulumi.flexibleengine.VpcV1Args;
    import com.pulumi.flexibleengine.FlexibleengineFunctions;
    import com.pulumi.flexibleengine.inputs.GetVpcRouteTableArgs;
    import com.pulumi.flexibleengine.VpcRoute;
    import com.pulumi.flexibleengine.VpcRouteArgs;
    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) {
            final var config = ctx.config();
            final var nexthop = config.get("nexthop");
            var exampleVpc = new VpcV1("exampleVpc", VpcV1Args.builder()
                .cidr("192.168.0.0/16")
                .build());
    
            final var rtb = FlexibleengineFunctions.getVpcRouteTable(GetVpcRouteTableArgs.builder()
                .vpcId(exampleVpc.vpcV1Id())
                .name("demo")
                .build());
    
            var vpcRoute = new VpcRoute("vpcRoute", VpcRouteArgs.builder()
                .vpcId(exampleVpc.vpcV1Id())
                .routeTableId(rtb.applyValue(getVpcRouteTableResult -> getVpcRouteTableResult).applyValue(rtb -> rtb.applyValue(getVpcRouteTableResult -> getVpcRouteTableResult.id())))
                .destination("172.16.8.0/24")
                .type("ecs")
                .nexthop(nexthop)
                .build());
    
        }
    }
    
    configuration:
      nexthop:
        type: dynamic
    resources:
      exampleVpc:
        type: flexibleengine:VpcV1
        properties:
          cidr: 192.168.0.0/16
      vpcRoute:
        type: flexibleengine:VpcRoute
        properties:
          vpcId: ${exampleVpc.vpcV1Id}
          routeTableId: ${rtb.id}
          destination: 172.16.8.0/24
          type: ecs
          nexthop: ${nexthop}
    variables:
      rtb:
        fn::invoke:
          function: flexibleengine:getVpcRouteTable
          arguments:
            vpcId: ${exampleVpc.vpcV1Id}
            name: demo
    

    Create VpcRoute Resource

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

    Constructor syntax

    new VpcRoute(name: string, args: VpcRouteArgs, opts?: CustomResourceOptions);
    @overload
    def VpcRoute(resource_name: str,
                 args: VpcRouteArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcRoute(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 destination: Optional[str] = None,
                 nexthop: Optional[str] = None,
                 type: Optional[str] = None,
                 vpc_id: Optional[str] = None,
                 description: Optional[str] = None,
                 region: Optional[str] = None,
                 route_table_id: Optional[str] = None,
                 timeouts: Optional[VpcRouteTimeoutsArgs] = None,
                 vpc_route_id: Optional[str] = None)
    func NewVpcRoute(ctx *Context, name string, args VpcRouteArgs, opts ...ResourceOption) (*VpcRoute, error)
    public VpcRoute(string name, VpcRouteArgs args, CustomResourceOptions? opts = null)
    public VpcRoute(String name, VpcRouteArgs args)
    public VpcRoute(String name, VpcRouteArgs args, CustomResourceOptions options)
    
    type: flexibleengine:VpcRoute
    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 VpcRouteArgs
    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 VpcRouteArgs
    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 VpcRouteArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcRouteArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcRouteArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var vpcRouteResource = new Flexibleengine.VpcRoute("vpcRouteResource", new()
    {
        Destination = "string",
        Nexthop = "string",
        Type = "string",
        VpcId = "string",
        Description = "string",
        Region = "string",
        RouteTableId = "string",
        Timeouts = new Flexibleengine.Inputs.VpcRouteTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
        },
        VpcRouteId = "string",
    });
    
    example, err := flexibleengine.NewVpcRoute(ctx, "vpcRouteResource", &flexibleengine.VpcRouteArgs{
    	Destination:  pulumi.String("string"),
    	Nexthop:      pulumi.String("string"),
    	Type:         pulumi.String("string"),
    	VpcId:        pulumi.String("string"),
    	Description:  pulumi.String("string"),
    	Region:       pulumi.String("string"),
    	RouteTableId: pulumi.String("string"),
    	Timeouts: &flexibleengine.VpcRouteTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    	},
    	VpcRouteId: pulumi.String("string"),
    })
    
    var vpcRouteResource = new VpcRoute("vpcRouteResource", VpcRouteArgs.builder()
        .destination("string")
        .nexthop("string")
        .type("string")
        .vpcId("string")
        .description("string")
        .region("string")
        .routeTableId("string")
        .timeouts(VpcRouteTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .build())
        .vpcRouteId("string")
        .build());
    
    vpc_route_resource = flexibleengine.VpcRoute("vpcRouteResource",
        destination="string",
        nexthop="string",
        type="string",
        vpc_id="string",
        description="string",
        region="string",
        route_table_id="string",
        timeouts={
            "create": "string",
            "delete": "string",
        },
        vpc_route_id="string")
    
    const vpcRouteResource = new flexibleengine.VpcRoute("vpcRouteResource", {
        destination: "string",
        nexthop: "string",
        type: "string",
        vpcId: "string",
        description: "string",
        region: "string",
        routeTableId: "string",
        timeouts: {
            create: "string",
            "delete": "string",
        },
        vpcRouteId: "string",
    });
    
    type: flexibleengine:VpcRoute
    properties:
        description: string
        destination: string
        nexthop: string
        region: string
        routeTableId: string
        timeouts:
            create: string
            delete: string
        type: string
        vpcId: string
        vpcRouteId: string
    

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

    Destination string
    Specifies the destination address in the CIDR notation format, for example, 192.168.200.0/24. The destination of each route must be unique and cannot overlap with any subnet in the VPC. Changing this creates a new resource.
    Nexthop string
    Specifies the next hop.

    • If the route type is ecs, the value is an ECS instance ID in the VPC.
    • If the route type is eni, the value is the extension NIC of an ECS in the VPC.
    • If the route type is vip, the value is a virtual IP address.
    • If the route type is nat, the value is a VPN gateway ID.
    • If the route type is peering, the value is a VPC peering connection ID.
    • If the route type is vpn, the value is a VPN gateway ID.
    • If the route type is dc, the value is a Direct Connect gateway ID.
    Type string
    Specifies the route type. Currently, the value can be: ecs, eni, vip, nat, peering, vpn and dc.
    VpcId string
    Specifies the VPC for which a route is to be added. Changing this creates a new resource.
    Description string
    Specifies the supplementary information about the route. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).
    Region string
    The region in which to create the VPC route. If omitted, the provider-level region will be used. Changing this creates a new resource.
    RouteTableId string
    Specifies the route table ID for which a route is to be added. If the value is not set, the route will be added to the default route table.
    Timeouts VpcRouteTimeouts
    VpcRouteId string
    The route ID, the format is <route_table_id>/<destination>
    Destination string
    Specifies the destination address in the CIDR notation format, for example, 192.168.200.0/24. The destination of each route must be unique and cannot overlap with any subnet in the VPC. Changing this creates a new resource.
    Nexthop string
    Specifies the next hop.

    • If the route type is ecs, the value is an ECS instance ID in the VPC.
    • If the route type is eni, the value is the extension NIC of an ECS in the VPC.
    • If the route type is vip, the value is a virtual IP address.
    • If the route type is nat, the value is a VPN gateway ID.
    • If the route type is peering, the value is a VPC peering connection ID.
    • If the route type is vpn, the value is a VPN gateway ID.
    • If the route type is dc, the value is a Direct Connect gateway ID.
    Type string
    Specifies the route type. Currently, the value can be: ecs, eni, vip, nat, peering, vpn and dc.
    VpcId string
    Specifies the VPC for which a route is to be added. Changing this creates a new resource.
    Description string
    Specifies the supplementary information about the route. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).
    Region string
    The region in which to create the VPC route. If omitted, the provider-level region will be used. Changing this creates a new resource.
    RouteTableId string
    Specifies the route table ID for which a route is to be added. If the value is not set, the route will be added to the default route table.
    Timeouts VpcRouteTimeoutsArgs
    VpcRouteId string
    The route ID, the format is <route_table_id>/<destination>
    destination String
    Specifies the destination address in the CIDR notation format, for example, 192.168.200.0/24. The destination of each route must be unique and cannot overlap with any subnet in the VPC. Changing this creates a new resource.
    nexthop String
    Specifies the next hop.

    • If the route type is ecs, the value is an ECS instance ID in the VPC.
    • If the route type is eni, the value is the extension NIC of an ECS in the VPC.
    • If the route type is vip, the value is a virtual IP address.
    • If the route type is nat, the value is a VPN gateway ID.
    • If the route type is peering, the value is a VPC peering connection ID.
    • If the route type is vpn, the value is a VPN gateway ID.
    • If the route type is dc, the value is a Direct Connect gateway ID.
    type String
    Specifies the route type. Currently, the value can be: ecs, eni, vip, nat, peering, vpn and dc.
    vpcId String
    Specifies the VPC for which a route is to be added. Changing this creates a new resource.
    description String
    Specifies the supplementary information about the route. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).
    region String
    The region in which to create the VPC route. If omitted, the provider-level region will be used. Changing this creates a new resource.
    routeTableId String
    Specifies the route table ID for which a route is to be added. If the value is not set, the route will be added to the default route table.
    timeouts VpcRouteTimeouts
    vpcRouteId String
    The route ID, the format is <route_table_id>/<destination>
    destination string
    Specifies the destination address in the CIDR notation format, for example, 192.168.200.0/24. The destination of each route must be unique and cannot overlap with any subnet in the VPC. Changing this creates a new resource.
    nexthop string
    Specifies the next hop.

    • If the route type is ecs, the value is an ECS instance ID in the VPC.
    • If the route type is eni, the value is the extension NIC of an ECS in the VPC.
    • If the route type is vip, the value is a virtual IP address.
    • If the route type is nat, the value is a VPN gateway ID.
    • If the route type is peering, the value is a VPC peering connection ID.
    • If the route type is vpn, the value is a VPN gateway ID.
    • If the route type is dc, the value is a Direct Connect gateway ID.
    type string
    Specifies the route type. Currently, the value can be: ecs, eni, vip, nat, peering, vpn and dc.
    vpcId string
    Specifies the VPC for which a route is to be added. Changing this creates a new resource.
    description string
    Specifies the supplementary information about the route. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).
    region string
    The region in which to create the VPC route. If omitted, the provider-level region will be used. Changing this creates a new resource.
    routeTableId string
    Specifies the route table ID for which a route is to be added. If the value is not set, the route will be added to the default route table.
    timeouts VpcRouteTimeouts
    vpcRouteId string
    The route ID, the format is <route_table_id>/<destination>
    destination str
    Specifies the destination address in the CIDR notation format, for example, 192.168.200.0/24. The destination of each route must be unique and cannot overlap with any subnet in the VPC. Changing this creates a new resource.
    nexthop str
    Specifies the next hop.

    • If the route type is ecs, the value is an ECS instance ID in the VPC.
    • If the route type is eni, the value is the extension NIC of an ECS in the VPC.
    • If the route type is vip, the value is a virtual IP address.
    • If the route type is nat, the value is a VPN gateway ID.
    • If the route type is peering, the value is a VPC peering connection ID.
    • If the route type is vpn, the value is a VPN gateway ID.
    • If the route type is dc, the value is a Direct Connect gateway ID.
    type str
    Specifies the route type. Currently, the value can be: ecs, eni, vip, nat, peering, vpn and dc.
    vpc_id str
    Specifies the VPC for which a route is to be added. Changing this creates a new resource.
    description str
    Specifies the supplementary information about the route. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).
    region str
    The region in which to create the VPC route. If omitted, the provider-level region will be used. Changing this creates a new resource.
    route_table_id str
    Specifies the route table ID for which a route is to be added. If the value is not set, the route will be added to the default route table.
    timeouts VpcRouteTimeoutsArgs
    vpc_route_id str
    The route ID, the format is <route_table_id>/<destination>
    destination String
    Specifies the destination address in the CIDR notation format, for example, 192.168.200.0/24. The destination of each route must be unique and cannot overlap with any subnet in the VPC. Changing this creates a new resource.
    nexthop String
    Specifies the next hop.

    • If the route type is ecs, the value is an ECS instance ID in the VPC.
    • If the route type is eni, the value is the extension NIC of an ECS in the VPC.
    • If the route type is vip, the value is a virtual IP address.
    • If the route type is nat, the value is a VPN gateway ID.
    • If the route type is peering, the value is a VPC peering connection ID.
    • If the route type is vpn, the value is a VPN gateway ID.
    • If the route type is dc, the value is a Direct Connect gateway ID.
    type String
    Specifies the route type. Currently, the value can be: ecs, eni, vip, nat, peering, vpn and dc.
    vpcId String
    Specifies the VPC for which a route is to be added. Changing this creates a new resource.
    description String
    Specifies the supplementary information about the route. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).
    region String
    The region in which to create the VPC route. If omitted, the provider-level region will be used. Changing this creates a new resource.
    routeTableId String
    Specifies the route table ID for which a route is to be added. If the value is not set, the route will be added to the default route table.
    timeouts Property Map
    vpcRouteId String
    The route ID, the format is <route_table_id>/<destination>

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    RouteTableName string
    The name of route table.
    Id string
    The provider-assigned unique ID for this managed resource.
    RouteTableName string
    The name of route table.
    id String
    The provider-assigned unique ID for this managed resource.
    routeTableName String
    The name of route table.
    id string
    The provider-assigned unique ID for this managed resource.
    routeTableName string
    The name of route table.
    id str
    The provider-assigned unique ID for this managed resource.
    route_table_name str
    The name of route table.
    id String
    The provider-assigned unique ID for this managed resource.
    routeTableName String
    The name of route table.

    Look up Existing VpcRoute Resource

    Get an existing VpcRoute 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?: VpcRouteState, opts?: CustomResourceOptions): VpcRoute
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            destination: Optional[str] = None,
            nexthop: Optional[str] = None,
            region: Optional[str] = None,
            route_table_id: Optional[str] = None,
            route_table_name: Optional[str] = None,
            timeouts: Optional[VpcRouteTimeoutsArgs] = None,
            type: Optional[str] = None,
            vpc_id: Optional[str] = None,
            vpc_route_id: Optional[str] = None) -> VpcRoute
    func GetVpcRoute(ctx *Context, name string, id IDInput, state *VpcRouteState, opts ...ResourceOption) (*VpcRoute, error)
    public static VpcRoute Get(string name, Input<string> id, VpcRouteState? state, CustomResourceOptions? opts = null)
    public static VpcRoute get(String name, Output<String> id, VpcRouteState state, CustomResourceOptions options)
    resources:  _:    type: flexibleengine:VpcRoute    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:
    Description string
    Specifies the supplementary information about the route. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).
    Destination string
    Specifies the destination address in the CIDR notation format, for example, 192.168.200.0/24. The destination of each route must be unique and cannot overlap with any subnet in the VPC. Changing this creates a new resource.
    Nexthop string
    Specifies the next hop.

    • If the route type is ecs, the value is an ECS instance ID in the VPC.
    • If the route type is eni, the value is the extension NIC of an ECS in the VPC.
    • If the route type is vip, the value is a virtual IP address.
    • If the route type is nat, the value is a VPN gateway ID.
    • If the route type is peering, the value is a VPC peering connection ID.
    • If the route type is vpn, the value is a VPN gateway ID.
    • If the route type is dc, the value is a Direct Connect gateway ID.
    Region string
    The region in which to create the VPC route. If omitted, the provider-level region will be used. Changing this creates a new resource.
    RouteTableId string
    Specifies the route table ID for which a route is to be added. If the value is not set, the route will be added to the default route table.
    RouteTableName string
    The name of route table.
    Timeouts VpcRouteTimeouts
    Type string
    Specifies the route type. Currently, the value can be: ecs, eni, vip, nat, peering, vpn and dc.
    VpcId string
    Specifies the VPC for which a route is to be added. Changing this creates a new resource.
    VpcRouteId string
    The route ID, the format is <route_table_id>/<destination>
    Description string
    Specifies the supplementary information about the route. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).
    Destination string
    Specifies the destination address in the CIDR notation format, for example, 192.168.200.0/24. The destination of each route must be unique and cannot overlap with any subnet in the VPC. Changing this creates a new resource.
    Nexthop string
    Specifies the next hop.

    • If the route type is ecs, the value is an ECS instance ID in the VPC.
    • If the route type is eni, the value is the extension NIC of an ECS in the VPC.
    • If the route type is vip, the value is a virtual IP address.
    • If the route type is nat, the value is a VPN gateway ID.
    • If the route type is peering, the value is a VPC peering connection ID.
    • If the route type is vpn, the value is a VPN gateway ID.
    • If the route type is dc, the value is a Direct Connect gateway ID.
    Region string
    The region in which to create the VPC route. If omitted, the provider-level region will be used. Changing this creates a new resource.
    RouteTableId string
    Specifies the route table ID for which a route is to be added. If the value is not set, the route will be added to the default route table.
    RouteTableName string
    The name of route table.
    Timeouts VpcRouteTimeoutsArgs
    Type string
    Specifies the route type. Currently, the value can be: ecs, eni, vip, nat, peering, vpn and dc.
    VpcId string
    Specifies the VPC for which a route is to be added. Changing this creates a new resource.
    VpcRouteId string
    The route ID, the format is <route_table_id>/<destination>
    description String
    Specifies the supplementary information about the route. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).
    destination String
    Specifies the destination address in the CIDR notation format, for example, 192.168.200.0/24. The destination of each route must be unique and cannot overlap with any subnet in the VPC. Changing this creates a new resource.
    nexthop String
    Specifies the next hop.

    • If the route type is ecs, the value is an ECS instance ID in the VPC.
    • If the route type is eni, the value is the extension NIC of an ECS in the VPC.
    • If the route type is vip, the value is a virtual IP address.
    • If the route type is nat, the value is a VPN gateway ID.
    • If the route type is peering, the value is a VPC peering connection ID.
    • If the route type is vpn, the value is a VPN gateway ID.
    • If the route type is dc, the value is a Direct Connect gateway ID.
    region String
    The region in which to create the VPC route. If omitted, the provider-level region will be used. Changing this creates a new resource.
    routeTableId String
    Specifies the route table ID for which a route is to be added. If the value is not set, the route will be added to the default route table.
    routeTableName String
    The name of route table.
    timeouts VpcRouteTimeouts
    type String
    Specifies the route type. Currently, the value can be: ecs, eni, vip, nat, peering, vpn and dc.
    vpcId String
    Specifies the VPC for which a route is to be added. Changing this creates a new resource.
    vpcRouteId String
    The route ID, the format is <route_table_id>/<destination>
    description string
    Specifies the supplementary information about the route. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).
    destination string
    Specifies the destination address in the CIDR notation format, for example, 192.168.200.0/24. The destination of each route must be unique and cannot overlap with any subnet in the VPC. Changing this creates a new resource.
    nexthop string
    Specifies the next hop.

    • If the route type is ecs, the value is an ECS instance ID in the VPC.
    • If the route type is eni, the value is the extension NIC of an ECS in the VPC.
    • If the route type is vip, the value is a virtual IP address.
    • If the route type is nat, the value is a VPN gateway ID.
    • If the route type is peering, the value is a VPC peering connection ID.
    • If the route type is vpn, the value is a VPN gateway ID.
    • If the route type is dc, the value is a Direct Connect gateway ID.
    region string
    The region in which to create the VPC route. If omitted, the provider-level region will be used. Changing this creates a new resource.
    routeTableId string
    Specifies the route table ID for which a route is to be added. If the value is not set, the route will be added to the default route table.
    routeTableName string
    The name of route table.
    timeouts VpcRouteTimeouts
    type string
    Specifies the route type. Currently, the value can be: ecs, eni, vip, nat, peering, vpn and dc.
    vpcId string
    Specifies the VPC for which a route is to be added. Changing this creates a new resource.
    vpcRouteId string
    The route ID, the format is <route_table_id>/<destination>
    description str
    Specifies the supplementary information about the route. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).
    destination str
    Specifies the destination address in the CIDR notation format, for example, 192.168.200.0/24. The destination of each route must be unique and cannot overlap with any subnet in the VPC. Changing this creates a new resource.
    nexthop str
    Specifies the next hop.

    • If the route type is ecs, the value is an ECS instance ID in the VPC.
    • If the route type is eni, the value is the extension NIC of an ECS in the VPC.
    • If the route type is vip, the value is a virtual IP address.
    • If the route type is nat, the value is a VPN gateway ID.
    • If the route type is peering, the value is a VPC peering connection ID.
    • If the route type is vpn, the value is a VPN gateway ID.
    • If the route type is dc, the value is a Direct Connect gateway ID.
    region str
    The region in which to create the VPC route. If omitted, the provider-level region will be used. Changing this creates a new resource.
    route_table_id str
    Specifies the route table ID for which a route is to be added. If the value is not set, the route will be added to the default route table.
    route_table_name str
    The name of route table.
    timeouts VpcRouteTimeoutsArgs
    type str
    Specifies the route type. Currently, the value can be: ecs, eni, vip, nat, peering, vpn and dc.
    vpc_id str
    Specifies the VPC for which a route is to be added. Changing this creates a new resource.
    vpc_route_id str
    The route ID, the format is <route_table_id>/<destination>
    description String
    Specifies the supplementary information about the route. The value is a string of no more than 255 characters and cannot contain angle brackets (< or >).
    destination String
    Specifies the destination address in the CIDR notation format, for example, 192.168.200.0/24. The destination of each route must be unique and cannot overlap with any subnet in the VPC. Changing this creates a new resource.
    nexthop String
    Specifies the next hop.

    • If the route type is ecs, the value is an ECS instance ID in the VPC.
    • If the route type is eni, the value is the extension NIC of an ECS in the VPC.
    • If the route type is vip, the value is a virtual IP address.
    • If the route type is nat, the value is a VPN gateway ID.
    • If the route type is peering, the value is a VPC peering connection ID.
    • If the route type is vpn, the value is a VPN gateway ID.
    • If the route type is dc, the value is a Direct Connect gateway ID.
    region String
    The region in which to create the VPC route. If omitted, the provider-level region will be used. Changing this creates a new resource.
    routeTableId String
    Specifies the route table ID for which a route is to be added. If the value is not set, the route will be added to the default route table.
    routeTableName String
    The name of route table.
    timeouts Property Map
    type String
    Specifies the route type. Currently, the value can be: ecs, eni, vip, nat, peering, vpn and dc.
    vpcId String
    Specifies the VPC for which a route is to be added. Changing this creates a new resource.
    vpcRouteId String
    The route ID, the format is <route_table_id>/<destination>

    Supporting Types

    VpcRouteTimeouts, VpcRouteTimeoutsArgs

    Create string
    Delete string
    Create string
    Delete string
    create String
    delete String
    create string
    delete string
    create str
    delete str
    create String
    delete String

    Import

    VPC routes can be imported using the route table ID and their destination separated by a slash, e.g.

    $ pulumi import flexibleengine:index/vpcRoute:VpcRoute test <route_table_id>/<destination>
    

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

    Package Details

    Repository
    flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
    License
    Notes
    This Pulumi package is based on the flexibleengine Terraform Provider.
    flexibleengine logo
    flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud