flexibleengine.getVpcV1
Explore with Pulumi AI
flexibleengine_vpc_v1 provides 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
The following example shows how one might accept a VPC id as a variable and use this data source to obtain the data necessary to create a subnet within it.
import * as pulumi from "@pulumi/pulumi";
import * as flexibleengine from "@pulumi/flexibleengine";
const config = new pulumi.Config();
const vpcName = config.requireObject("vpcName");
const vpc = flexibleengine.getVpcV1({
    name: vpcName,
});
import pulumi
import pulumi_flexibleengine as flexibleengine
config = pulumi.Config()
vpc_name = config.require_object("vpcName")
vpc = flexibleengine.get_vpc_v1(name=vpc_name)
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, "")
		vpcName := cfg.RequireObject("vpcName")
		_, err := flexibleengine.LookupVpcV1(ctx, &flexibleengine.LookupVpcV1Args{
			Name: pulumi.StringRef(vpcName),
		}, nil)
		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 vpcName = config.RequireObject<dynamic>("vpcName");
    var vpc = Flexibleengine.GetVpcV1.Invoke(new()
    {
        Name = vpcName,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.FlexibleengineFunctions;
import com.pulumi.flexibleengine.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 = FlexibleengineFunctions.getVpcV1(GetVpcV1Args.builder()
            .name(vpcName)
            .build());
    }
}
configuration:
  vpcName:
    type: dynamic
variables:
  vpc:
    fn::invoke:
      function: flexibleengine:getVpcV1
      arguments:
        name: ${vpcName}
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>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]func LookupVpcV1(ctx *Context, args *LookupVpcV1Args, opts ...InvokeOption) (*LookupVpcV1Result, error)
func LookupVpcV1Output(ctx *Context, args *LookupVpcV1OutputArgs, opts ...InvokeOption) LookupVpcV1ResultOutput> 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)
}public static CompletableFuture<GetVpcV1Result> getVpcV1(GetVpcV1Args args, InvokeOptions options)
public static Output<GetVpcV1Result> getVpcV1(GetVpcV1Args args, InvokeOptions options)
fn::invoke:
  function: flexibleengine:index/getVpcV1:getVpcV1
  arguments:
    # arguments dictionaryThe 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
 - The region in which to obtain the V1 VPC client. A VPC client is needed to retrieve VPCs. If omitted, the region argument of the provider is used.
 - bool
 - Specifies whether the cross-tenant sharing is supported.
 - 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
 - The region in which to obtain the V1 VPC client. A VPC client is needed to retrieve VPCs. If omitted, the region argument of the provider is used.
 - bool
 - Specifies whether the cross-tenant sharing is supported.
 - 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
 - The region in which to obtain the V1 VPC client. A VPC client is needed to retrieve VPCs. If omitted, the region argument of the provider is used.
 - Boolean
 - Specifies whether the cross-tenant sharing is supported.
 - 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
 - The region in which to obtain the V1 VPC client. A VPC client is needed to retrieve VPCs. If omitted, the region argument of the provider is used.
 - boolean
 - Specifies whether the cross-tenant sharing is supported.
 - 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
 - The region in which to obtain the V1 VPC client. A VPC client is needed to retrieve VPCs. If omitted, the region argument of the provider is used.
 - bool
 - Specifies whether the cross-tenant sharing is supported.
 - 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
 - The region in which to obtain the V1 VPC client. A VPC client is needed to retrieve VPCs. If omitted, the region argument of the provider is used.
 - Boolean
 - Specifies whether the cross-tenant sharing is supported.
 - 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
 - See Argument Reference above.
 - Routes
List<Get
Vpc V1Route>  - 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.
 - bool
 - Specifies whether the cross-tenant sharing is supported.
 - Status string
 - See Argument Reference above.
 
- Region string
 - See Argument Reference above.
 - Routes
[]Get
Vpc V1Route  - 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.
 - bool
 - Specifies whether the cross-tenant sharing is supported.
 - Status string
 - See Argument Reference above.
 
- region String
 - See Argument Reference above.
 - routes
List<Get
Vpc V1Route>  - 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.
 - Boolean
 - Specifies whether the cross-tenant sharing is supported.
 - status String
 - See Argument Reference above.
 
- region string
 - See Argument Reference above.
 - routes
Get
Vpc V1Route[]  - 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.
 - boolean
 - Specifies whether the cross-tenant sharing is supported.
 - status string
 - See Argument Reference above.
 
- region str
 - See Argument Reference above.
 - routes
Sequence[Get
Vpc V1Route]  - 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.
 - bool
 - Specifies whether the cross-tenant sharing is supported.
 - status str
 - See Argument Reference above.
 
- region String
 - See Argument Reference above.
 - 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.
 - Boolean
 - Specifies whether the cross-tenant sharing is supported.
 - status String
 - See Argument Reference above.
 
Supporting Types
GetVpcV1Route  
- Destination string
 - The destination network segment of a route.
 - Nexthop string
 - The next hop of a route.
 
- Destination string
 - The destination network segment of a route.
 - Nexthop string
 - The next hop of a route.
 
- destination String
 - The destination network segment of a route.
 - nexthop String
 - The next hop of a route.
 
- destination string
 - The destination network segment of a route.
 - nexthop string
 - The next hop of a route.
 
- destination str
 - The destination network segment of a route.
 - nexthop str
 - The next hop of a route.
 
- destination String
 - The destination network segment of a route.
 - nexthop String
 - The next hop of a route.
 
Package Details
- Repository
 - flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
 - License
 - Notes
 - This Pulumi package is based on the 
flexibleengineTerraform Provider.