1. Packages
  2. Opentelekomcloud Provider
  3. API Docs
  4. getVpcV1
opentelekomcloud 1.36.35 published on Monday, Apr 14, 2025 by opentelekomcloud

opentelekomcloud.getVpcV1

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 you can get at documentation portal

Use this data source to get details about a specific VPC.

This data source can prove useful when a module accepts a VPC id as an input variable and needs to, for example, determine the CIDR block of that VPC.

Example Usage

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

const config = new pulumi.Config();
const vpcName = config.requireObject("vpcName");
const vpc = opentelekomcloud.getVpcV1({
    name: vpcName,
    shared: true,
});
Copy
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud

config = pulumi.Config()
vpc_name = config.require_object("vpcName")
vpc = opentelekomcloud.get_vpc_v1(name=vpc_name,
    shared=True)
Copy
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, "")
		vpcName := cfg.RequireObject("vpcName")
		_, err := opentelekomcloud.LookupVpcV1(ctx, &opentelekomcloud.LookupVpcV1Args{
			Name:   pulumi.StringRef(vpcName),
			Shared: pulumi.BoolRef(true),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var vpcName = config.RequireObject<dynamic>("vpcName");
    var vpc = Opentelekomcloud.GetVpcV1.Invoke(new()
    {
        Name = vpcName,
        Shared = true,
    });

});
Copy
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.GetVpcV1Args;
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 vpcName = config.get("vpcName");
        final var vpc = OpentelekomcloudFunctions.getVpcV1(GetVpcV1Args.builder()
            .name(vpcName)
            .shared(true)
            .build());

    }
}
Copy
configuration:
  vpcName:
    type: dynamic
variables:
  vpc:
    fn::invoke:
      function: opentelekomcloud:getVpcV1
      arguments:
        name: ${vpcName}
        shared: true
Copy

Using getVpcV1

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 getVpcV1(args: GetVpcV1Args, opts?: InvokeOptions): Promise<GetVpcV1Result>
function getVpcV1Output(args: GetVpcV1OutputArgs, opts?: InvokeOptions): Output<GetVpcV1Result>
Copy
def get_vpc_v1(cidr: Optional[str] = None,
               id: Optional[str] = None,
               name: Optional[str] = None,
               region: Optional[str] = None,
               shared: Optional[bool] = None,
               status: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetVpcV1Result
def get_vpc_v1_output(cidr: Optional[pulumi.Input[str]] = None,
               id: Optional[pulumi.Input[str]] = None,
               name: Optional[pulumi.Input[str]] = None,
               region: Optional[pulumi.Input[str]] = None,
               shared: Optional[pulumi.Input[bool]] = None,
               status: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetVpcV1Result]
Copy
func LookupVpcV1(ctx *Context, args *LookupVpcV1Args, opts ...InvokeOption) (*LookupVpcV1Result, error)
func LookupVpcV1Output(ctx *Context, args *LookupVpcV1OutputArgs, opts ...InvokeOption) LookupVpcV1ResultOutput
Copy

> Note: This function is named LookupVpcV1 in the Go SDK.

public static class GetVpcV1 
{
    public static Task<GetVpcV1Result> InvokeAsync(GetVpcV1Args args, InvokeOptions? opts = null)
    public static Output<GetVpcV1Result> Invoke(GetVpcV1InvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetVpcV1Result> getVpcV1(GetVpcV1Args args, InvokeOptions options)
public static Output<GetVpcV1Result> getVpcV1(GetVpcV1Args args, InvokeOptions options)
Copy
fn::invoke:
  function: opentelekomcloud:index/getVpcV1:getVpcV1
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Cidr string
The cidr block of the desired VPC.
Id string
The id of the specific VPC to retrieve.
Name string
A unique name for the VPC. The name must be unique for a tenant. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_), and hyphens (-).
Region string
Shared bool
Enable SNAT (In order to let instances without an EIP access the internet).
Status string
The current status of the desired VPC. Can be either CREATING, OK, DOWN, PENDING_UPDATE, PENDING_DELETE, or ERROR.
Cidr string
The cidr block of the desired VPC.
Id string
The id of the specific VPC to retrieve.
Name string
A unique name for the VPC. The name must be unique for a tenant. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_), and hyphens (-).
Region string
Shared bool
Enable SNAT (In order to let instances without an EIP access the internet).
Status string
The current status of the desired VPC. Can be either CREATING, OK, DOWN, PENDING_UPDATE, PENDING_DELETE, or ERROR.
cidr String
The cidr block of the desired VPC.
id String
The id of the specific VPC to retrieve.
name String
A unique name for the VPC. The name must be unique for a tenant. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_), and hyphens (-).
region String
shared Boolean
Enable SNAT (In order to let instances without an EIP access the internet).
status String
The current status of the desired VPC. Can be either CREATING, OK, DOWN, PENDING_UPDATE, PENDING_DELETE, or ERROR.
cidr string
The cidr block of the desired VPC.
id string
The id of the specific VPC to retrieve.
name string
A unique name for the VPC. The name must be unique for a tenant. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_), and hyphens (-).
region string
shared boolean
Enable SNAT (In order to let instances without an EIP access the internet).
status string
The current status of the desired VPC. Can be either CREATING, OK, DOWN, PENDING_UPDATE, PENDING_DELETE, or ERROR.
cidr str
The cidr block of the desired VPC.
id str
The id of the specific VPC to retrieve.
name str
A unique name for the VPC. The name must be unique for a tenant. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_), and hyphens (-).
region str
shared bool
Enable SNAT (In order to let instances without an EIP access the internet).
status str
The current status of the desired VPC. Can be either CREATING, OK, DOWN, PENDING_UPDATE, PENDING_DELETE, or ERROR.
cidr String
The cidr block of the desired VPC.
id String
The id of the specific VPC to retrieve.
name String
A unique name for the VPC. The name must be unique for a tenant. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_), and hyphens (-).
region String
shared Boolean
Enable SNAT (In order to let instances without an EIP access the internet).
status String
The current status of the desired VPC. Can be either CREATING, OK, DOWN, PENDING_UPDATE, PENDING_DELETE, or ERROR.

getVpcV1 Result

The following output properties are available:

Region string
Routes List<GetVpcV1Route>
The list of route information with destination and nexthop fields.
Cidr string
See Argument Reference above.
Id string
ID of the VPC.
Name string
See Argument Reference above.
Shared bool
Specifies whether the cross-tenant sharing is supported.
Status string
See Argument Reference above.
Region string
Routes []GetVpcV1Route
The list of route information with destination and nexthop fields.
Cidr string
See Argument Reference above.
Id string
ID of the VPC.
Name string
See Argument Reference above.
Shared bool
Specifies whether the cross-tenant sharing is supported.
Status string
See Argument Reference above.
region String
routes List<GetVpcV1Route>
The list of route information with destination and nexthop fields.
cidr String
See Argument Reference above.
id String
ID of the VPC.
name String
See Argument Reference above.
shared Boolean
Specifies whether the cross-tenant sharing is supported.
status String
See Argument Reference above.
region string
routes GetVpcV1Route[]
The list of route information with destination and nexthop fields.
cidr string
See Argument Reference above.
id string
ID of the VPC.
name string
See Argument Reference above.
shared boolean
Specifies whether the cross-tenant sharing is supported.
status string
See Argument Reference above.
region str
routes Sequence[GetVpcV1Route]
The list of route information with destination and nexthop fields.
cidr str
See Argument Reference above.
id str
ID of the VPC.
name str
See Argument Reference above.
shared bool
Specifies whether the cross-tenant sharing is supported.
status str
See Argument Reference above.
region String
routes List<Property Map>
The list of route information with destination and nexthop fields.
cidr String
See Argument Reference above.
id String
ID of the VPC.
name String
See Argument Reference above.
shared Boolean
Specifies whether the cross-tenant sharing is supported.
status String
See Argument Reference above.

Supporting Types

GetVpcV1Route

Destination This property is required. string
Nexthop This property is required. string
Destination This property is required. string
Nexthop This property is required. string
destination This property is required. String
nexthop This property is required. String
destination This property is required. string
nexthop This property is required. string
destination This property is required. str
nexthop This property is required. str
destination This property is required. String
nexthop This property is required. String

Package Details

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