opentelekomcloud 1.36.35 published on Monday, Apr 14, 2025 by opentelekomcloud
opentelekomcloud.getVpcRouteV2
Explore with Pulumi AI
opentelekomcloud 1.36.35 published on Monday, Apr 14, 2025 by opentelekomcloud
Up-to-date reference of API arguments for VPC route you can get at documentation portal
Use this data source to get details about a specific VPC route.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";
const config = new pulumi.Config();
const routeId = config.requireObject("routeId");
const vpcRoute = opentelekomcloud.getVpcRouteV2({
    id: routeId,
});
const subnetV1 = new opentelekomcloud.VpcSubnetV1("subnetV1", {
    cidr: "192.168.0.0/24",
    gatewayIp: "192.168.0.1",
    vpcId: vpcRoute.then(vpcRoute => vpcRoute.vpcId),
});
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud
config = pulumi.Config()
route_id = config.require_object("routeId")
vpc_route = opentelekomcloud.get_vpc_route_v2(id=route_id)
subnet_v1 = opentelekomcloud.VpcSubnetV1("subnetV1",
    cidr="192.168.0.0/24",
    gateway_ip="192.168.0.1",
    vpc_id=vpc_route.vpc_id)
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
	"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, "")
		routeId := cfg.RequireObject("routeId")
		vpcRoute, err := opentelekomcloud.LookupVpcRouteV2(ctx, &opentelekomcloud.LookupVpcRouteV2Args{
			Id: pulumi.StringRef(routeId),
		}, nil)
		if err != nil {
			return err
		}
		_, err = opentelekomcloud.NewVpcSubnetV1(ctx, "subnetV1", &opentelekomcloud.VpcSubnetV1Args{
			Cidr:      pulumi.String("192.168.0.0/24"),
			GatewayIp: pulumi.String("192.168.0.1"),
			VpcId:     pulumi.String(vpcRoute.VpcId),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;
return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var routeId = config.RequireObject<dynamic>("routeId");
    var vpcRoute = Opentelekomcloud.GetVpcRouteV2.Invoke(new()
    {
        Id = routeId,
    });
    var subnetV1 = new Opentelekomcloud.VpcSubnetV1("subnetV1", new()
    {
        Cidr = "192.168.0.0/24",
        GatewayIp = "192.168.0.1",
        VpcId = vpcRoute.Apply(getVpcRouteV2Result => getVpcRouteV2Result.VpcId),
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.OpentelekomcloudFunctions;
import com.pulumi.opentelekomcloud.inputs.GetVpcRouteV2Args;
import com.pulumi.opentelekomcloud.VpcSubnetV1;
import com.pulumi.opentelekomcloud.VpcSubnetV1Args;
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 routeId = config.get("routeId");
        final var vpcRoute = OpentelekomcloudFunctions.getVpcRouteV2(GetVpcRouteV2Args.builder()
            .id(routeId)
            .build());
        var subnetV1 = new VpcSubnetV1("subnetV1", VpcSubnetV1Args.builder()
            .cidr("192.168.0.0/24")
            .gatewayIp("192.168.0.1")
            .vpcId(vpcRoute.applyValue(getVpcRouteV2Result -> getVpcRouteV2Result.vpcId()))
            .build());
    }
}
configuration:
  routeId:
    type: dynamic
resources:
  subnetV1:
    type: opentelekomcloud:VpcSubnetV1
    properties:
      cidr: 192.168.0.0/24
      gatewayIp: 192.168.0.1
      vpcId: ${vpcRoute.vpcId}
variables:
  vpcRoute:
    fn::invoke:
      function: opentelekomcloud:getVpcRouteV2
      arguments:
        id: ${routeId}
Using getVpcRouteV2
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVpcRouteV2(args: GetVpcRouteV2Args, opts?: InvokeOptions): Promise<GetVpcRouteV2Result>
function getVpcRouteV2Output(args: GetVpcRouteV2OutputArgs, opts?: InvokeOptions): Output<GetVpcRouteV2Result>def get_vpc_route_v2(destination: Optional[str] = None,
                     id: Optional[str] = None,
                     nexthop: Optional[str] = None,
                     region: Optional[str] = None,
                     tenant_id: Optional[str] = None,
                     type: Optional[str] = None,
                     vpc_id: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetVpcRouteV2Result
def get_vpc_route_v2_output(destination: Optional[pulumi.Input[str]] = None,
                     id: Optional[pulumi.Input[str]] = None,
                     nexthop: Optional[pulumi.Input[str]] = None,
                     region: Optional[pulumi.Input[str]] = None,
                     tenant_id: Optional[pulumi.Input[str]] = None,
                     type: Optional[pulumi.Input[str]] = None,
                     vpc_id: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetVpcRouteV2Result]func LookupVpcRouteV2(ctx *Context, args *LookupVpcRouteV2Args, opts ...InvokeOption) (*LookupVpcRouteV2Result, error)
func LookupVpcRouteV2Output(ctx *Context, args *LookupVpcRouteV2OutputArgs, opts ...InvokeOption) LookupVpcRouteV2ResultOutput> Note: This function is named LookupVpcRouteV2 in the Go SDK.
public static class GetVpcRouteV2 
{
    public static Task<GetVpcRouteV2Result> InvokeAsync(GetVpcRouteV2Args args, InvokeOptions? opts = null)
    public static Output<GetVpcRouteV2Result> Invoke(GetVpcRouteV2InvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVpcRouteV2Result> getVpcRouteV2(GetVpcRouteV2Args args, InvokeOptions options)
public static Output<GetVpcRouteV2Result> getVpcRouteV2(GetVpcRouteV2Args args, InvokeOptions options)
fn::invoke:
  function: opentelekomcloud:index/getVpcRouteV2:getVpcRouteV2
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Destination string
- The route destination address (CIDR).
- Id string
- The id of the specific route to retrieve.
- Nexthop string
- The next hop of the route. If the route type is peering, it will provide VPC peering connection ID.
- Region string
- TenantId string
- Only the administrator can specify the tenant ID of other tenants.
- Type string
- Route type for filtering.
- VpcId string
- The id of the VPC that the desired route belongs to.
- Destination string
- The route destination address (CIDR).
- Id string
- The id of the specific route to retrieve.
- Nexthop string
- The next hop of the route. If the route type is peering, it will provide VPC peering connection ID.
- Region string
- TenantId string
- Only the administrator can specify the tenant ID of other tenants.
- Type string
- Route type for filtering.
- VpcId string
- The id of the VPC that the desired route belongs to.
- destination String
- The route destination address (CIDR).
- id String
- The id of the specific route to retrieve.
- nexthop String
- The next hop of the route. If the route type is peering, it will provide VPC peering connection ID.
- region String
- tenantId String
- Only the administrator can specify the tenant ID of other tenants.
- type String
- Route type for filtering.
- vpcId String
- The id of the VPC that the desired route belongs to.
- destination string
- The route destination address (CIDR).
- id string
- The id of the specific route to retrieve.
- nexthop string
- The next hop of the route. If the route type is peering, it will provide VPC peering connection ID.
- region string
- tenantId string
- Only the administrator can specify the tenant ID of other tenants.
- type string
- Route type for filtering.
- vpcId string
- The id of the VPC that the desired route belongs to.
- destination str
- The route destination address (CIDR).
- id str
- The id of the specific route to retrieve.
- nexthop str
- The next hop of the route. If the route type is peering, it will provide VPC peering connection ID.
- region str
- tenant_id str
- Only the administrator can specify the tenant ID of other tenants.
- type str
- Route type for filtering.
- vpc_id str
- The id of the VPC that the desired route belongs to.
- destination String
- The route destination address (CIDR).
- id String
- The id of the specific route to retrieve.
- nexthop String
- The next hop of the route. If the route type is peering, it will provide VPC peering connection ID.
- region String
- tenantId String
- Only the administrator can specify the tenant ID of other tenants.
- type String
- Route type for filtering.
- vpcId String
- The id of the VPC that the desired route belongs to.
getVpcRouteV2 Result
The following output properties are available:
Package Details
- Repository
- opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
- License
- Notes
- This Pulumi package is based on the opentelekomcloudTerraform Provider.
opentelekomcloud 1.36.35 published on Monday, Apr 14, 2025 by opentelekomcloud