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

flexibleengine.getVpcs

Explore with Pulumi AI

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

    Use this data source to get a list of VPC.

    Example Usage

    An example filter by name and tag

    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.getVpcs({
        name: vpcName,
        tags: {
            foo: "bar",
        },
    });
    export const vpcIds = vpc.then(vpc => vpc.vpcs.map(__item => __item.id));
    
    import pulumi
    import pulumi_flexibleengine as flexibleengine
    
    config = pulumi.Config()
    vpc_name = config.require_object("vpcName")
    vpc = flexibleengine.get_vpcs(name=vpc_name,
        tags={
            "foo": "bar",
        })
    pulumi.export("vpcIds", [__item.id for __item in vpc.vpcs])
    
    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")
    vpc, err := flexibleengine.GetVpcs(ctx, &flexibleengine.GetVpcsArgs{
    Name: pulumi.StringRef(vpcName),
    Tags: map[string]interface{}{
    "foo": "bar",
    },
    }, nil);
    if err != nil {
    return err
    }
    ctx.Export("vpcIds", pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ #-functions-%sflexibleengine:index-getVpcs:getVpcs.pp:8,11-25)))
    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.GetVpcs.Invoke(new()
        {
            Name = vpcName,
            Tags = 
            {
                { "foo", "bar" },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["vpcIds"] = vpc.Apply(getVpcsResult => getVpcsResult.Vpcs).Select(__item => __item.Id).ToList(),
        };
    });
    
    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.GetVpcsArgs;
    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.getVpcs(GetVpcsArgs.builder()
                .name(vpcName)
                .tags(Map.of("foo", "bar"))
                .build());
    
            ctx.export("vpcIds", vpc.applyValue(getVpcsResult -> getVpcsResult.vpcs()).stream().map(element -> element.id()).collect(toList()));
        }
    }
    
    Coming soon!
    

    Using getVpcs

    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 getVpcs(args: GetVpcsArgs, opts?: InvokeOptions): Promise<GetVpcsResult>
    function getVpcsOutput(args: GetVpcsOutputArgs, opts?: InvokeOptions): Output<GetVpcsResult>
    def get_vpcs(cidr: Optional[str] = None,
                 enterprise_project_id: Optional[str] = None,
                 id: Optional[str] = None,
                 name: Optional[str] = None,
                 region: Optional[str] = None,
                 status: Optional[str] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 opts: Optional[InvokeOptions] = None) -> GetVpcsResult
    def get_vpcs_output(cidr: Optional[pulumi.Input[str]] = None,
                 enterprise_project_id: Optional[pulumi.Input[str]] = None,
                 id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 status: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetVpcsResult]
    func GetVpcs(ctx *Context, args *GetVpcsArgs, opts ...InvokeOption) (*GetVpcsResult, error)
    func GetVpcsOutput(ctx *Context, args *GetVpcsOutputArgs, opts ...InvokeOption) GetVpcsResultOutput

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

    public static class GetVpcs 
    {
        public static Task<GetVpcsResult> InvokeAsync(GetVpcsArgs args, InvokeOptions? opts = null)
        public static Output<GetVpcsResult> Invoke(GetVpcsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpcsResult> getVpcs(GetVpcsArgs args, InvokeOptions options)
    public static Output<GetVpcsResult> getVpcs(GetVpcsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: flexibleengine:index/getVpcs:getVpcs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Cidr string
    Specifies the cidr block of the desired VPC.
    EnterpriseProjectId string
    Specifies the enterprise project ID which the desired VPC belongs to.
    Id string
    Specifies the id of the desired VPC.
    Name string
    Specifies the name of the desired VPC. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_) and hyphens (-).
    Region string
    Specifies the region in which to obtain the VPC. If omitted, the provider-level region will be used.
    Status string
    Specifies the current status of the desired VPC. The value can be CREATING, OK or ERROR.
    Tags Dictionary<string, string>

    Specifies the included key/value pairs which associated with the desired VPC.

    A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique, use commas(,) to separate the multiple values. An empty for values indicates any value. The values are in the OR relationship.

    Cidr string
    Specifies the cidr block of the desired VPC.
    EnterpriseProjectId string
    Specifies the enterprise project ID which the desired VPC belongs to.
    Id string
    Specifies the id of the desired VPC.
    Name string
    Specifies the name of the desired VPC. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_) and hyphens (-).
    Region string
    Specifies the region in which to obtain the VPC. If omitted, the provider-level region will be used.
    Status string
    Specifies the current status of the desired VPC. The value can be CREATING, OK or ERROR.
    Tags map[string]string

    Specifies the included key/value pairs which associated with the desired VPC.

    A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique, use commas(,) to separate the multiple values. An empty for values indicates any value. The values are in the OR relationship.

    cidr String
    Specifies the cidr block of the desired VPC.
    enterpriseProjectId String
    Specifies the enterprise project ID which the desired VPC belongs to.
    id String
    Specifies the id of the desired VPC.
    name String
    Specifies the name of the desired VPC. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_) and hyphens (-).
    region String
    Specifies the region in which to obtain the VPC. If omitted, the provider-level region will be used.
    status String
    Specifies the current status of the desired VPC. The value can be CREATING, OK or ERROR.
    tags Map<String,String>

    Specifies the included key/value pairs which associated with the desired VPC.

    A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique, use commas(,) to separate the multiple values. An empty for values indicates any value. The values are in the OR relationship.

    cidr string
    Specifies the cidr block of the desired VPC.
    enterpriseProjectId string
    Specifies the enterprise project ID which the desired VPC belongs to.
    id string
    Specifies the id of the desired VPC.
    name string
    Specifies the name of the desired VPC. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_) and hyphens (-).
    region string
    Specifies the region in which to obtain the VPC. If omitted, the provider-level region will be used.
    status string
    Specifies the current status of the desired VPC. The value can be CREATING, OK or ERROR.
    tags {[key: string]: string}

    Specifies the included key/value pairs which associated with the desired VPC.

    A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique, use commas(,) to separate the multiple values. An empty for values indicates any value. The values are in the OR relationship.

    cidr str
    Specifies the cidr block of the desired VPC.
    enterprise_project_id str
    Specifies the enterprise project ID which the desired VPC belongs to.
    id str
    Specifies the id of the desired VPC.
    name str
    Specifies the name of the desired VPC. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_) and hyphens (-).
    region str
    Specifies the region in which to obtain the VPC. If omitted, the provider-level region will be used.
    status str
    Specifies the current status of the desired VPC. The value can be CREATING, OK or ERROR.
    tags Mapping[str, str]

    Specifies the included key/value pairs which associated with the desired VPC.

    A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique, use commas(,) to separate the multiple values. An empty for values indicates any value. The values are in the OR relationship.

    cidr String
    Specifies the cidr block of the desired VPC.
    enterpriseProjectId String
    Specifies the enterprise project ID which the desired VPC belongs to.
    id String
    Specifies the id of the desired VPC.
    name String
    Specifies the name of the desired VPC. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_) and hyphens (-).
    region String
    Specifies the region in which to obtain the VPC. If omitted, the provider-level region will be used.
    status String
    Specifies the current status of the desired VPC. The value can be CREATING, OK or ERROR.
    tags Map<String>

    Specifies the included key/value pairs which associated with the desired VPC.

    A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique, use commas(,) to separate the multiple values. An empty for values indicates any value. The values are in the OR relationship.

    getVpcs Result

    The following output properties are available:

    Id string
    Indicates the ID of the VPC.
    Region string
    Vpcs List<GetVpcsVpc>
    Indicates a list of all VPCs found. The vpcs Structure is documented below.
    Cidr string
    Indicates the cidr block of the VPC.
    EnterpriseProjectId string
    Indicates the the enterprise project ID of the VPC.
    Name string
    Indicates the name of the VPC.
    Status string
    Indicates the current status of the VPC.
    Tags Dictionary<string, string>
    Indicates the key/value pairs which associated with the VPC.
    Id string
    Indicates the ID of the VPC.
    Region string
    Vpcs []GetVpcsVpc
    Indicates a list of all VPCs found. The vpcs Structure is documented below.
    Cidr string
    Indicates the cidr block of the VPC.
    EnterpriseProjectId string
    Indicates the the enterprise project ID of the VPC.
    Name string
    Indicates the name of the VPC.
    Status string
    Indicates the current status of the VPC.
    Tags map[string]string
    Indicates the key/value pairs which associated with the VPC.
    id String
    Indicates the ID of the VPC.
    region String
    vpcs List<GetVpcsVpc>
    Indicates a list of all VPCs found. The vpcs Structure is documented below.
    cidr String
    Indicates the cidr block of the VPC.
    enterpriseProjectId String
    Indicates the the enterprise project ID of the VPC.
    name String
    Indicates the name of the VPC.
    status String
    Indicates the current status of the VPC.
    tags Map<String,String>
    Indicates the key/value pairs which associated with the VPC.
    id string
    Indicates the ID of the VPC.
    region string
    vpcs GetVpcsVpc[]
    Indicates a list of all VPCs found. The vpcs Structure is documented below.
    cidr string
    Indicates the cidr block of the VPC.
    enterpriseProjectId string
    Indicates the the enterprise project ID of the VPC.
    name string
    Indicates the name of the VPC.
    status string
    Indicates the current status of the VPC.
    tags {[key: string]: string}
    Indicates the key/value pairs which associated with the VPC.
    id str
    Indicates the ID of the VPC.
    region str
    vpcs Sequence[GetVpcsVpc]
    Indicates a list of all VPCs found. The vpcs Structure is documented below.
    cidr str
    Indicates the cidr block of the VPC.
    enterprise_project_id str
    Indicates the the enterprise project ID of the VPC.
    name str
    Indicates the name of the VPC.
    status str
    Indicates the current status of the VPC.
    tags Mapping[str, str]
    Indicates the key/value pairs which associated with the VPC.
    id String
    Indicates the ID of the VPC.
    region String
    vpcs List<Property Map>
    Indicates a list of all VPCs found. The vpcs Structure is documented below.
    cidr String
    Indicates the cidr block of the VPC.
    enterpriseProjectId String
    Indicates the the enterprise project ID of the VPC.
    name String
    Indicates the name of the VPC.
    status String
    Indicates the current status of the VPC.
    tags Map<String>
    Indicates the key/value pairs which associated with the VPC.

    Supporting Types

    GetVpcsVpc

    Cidr string
    Specifies the cidr block of the desired VPC.
    Description string
    Indicates the description of the VPC.
    EnterpriseProjectId string
    Specifies the enterprise project ID which the desired VPC belongs to.
    Id string
    Specifies the id of the desired VPC.
    Name string
    Specifies the name of the desired VPC. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_) and hyphens (-).
    Status string
    Specifies the current status of the desired VPC. The value can be CREATING, OK or ERROR.
    Tags Dictionary<string, string>

    Specifies the included key/value pairs which associated with the desired VPC.

    A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique, use commas(,) to separate the multiple values. An empty for values indicates any value. The values are in the OR relationship.

    Cidr string
    Specifies the cidr block of the desired VPC.
    Description string
    Indicates the description of the VPC.
    EnterpriseProjectId string
    Specifies the enterprise project ID which the desired VPC belongs to.
    Id string
    Specifies the id of the desired VPC.
    Name string
    Specifies the name of the desired VPC. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_) and hyphens (-).
    Status string
    Specifies the current status of the desired VPC. The value can be CREATING, OK or ERROR.
    Tags map[string]string

    Specifies the included key/value pairs which associated with the desired VPC.

    A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique, use commas(,) to separate the multiple values. An empty for values indicates any value. The values are in the OR relationship.

    cidr String
    Specifies the cidr block of the desired VPC.
    description String
    Indicates the description of the VPC.
    enterpriseProjectId String
    Specifies the enterprise project ID which the desired VPC belongs to.
    id String
    Specifies the id of the desired VPC.
    name String
    Specifies the name of the desired VPC. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_) and hyphens (-).
    status String
    Specifies the current status of the desired VPC. The value can be CREATING, OK or ERROR.
    tags Map<String,String>

    Specifies the included key/value pairs which associated with the desired VPC.

    A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique, use commas(,) to separate the multiple values. An empty for values indicates any value. The values are in the OR relationship.

    cidr string
    Specifies the cidr block of the desired VPC.
    description string
    Indicates the description of the VPC.
    enterpriseProjectId string
    Specifies the enterprise project ID which the desired VPC belongs to.
    id string
    Specifies the id of the desired VPC.
    name string
    Specifies the name of the desired VPC. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_) and hyphens (-).
    status string
    Specifies the current status of the desired VPC. The value can be CREATING, OK or ERROR.
    tags {[key: string]: string}

    Specifies the included key/value pairs which associated with the desired VPC.

    A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique, use commas(,) to separate the multiple values. An empty for values indicates any value. The values are in the OR relationship.

    cidr str
    Specifies the cidr block of the desired VPC.
    description str
    Indicates the description of the VPC.
    enterprise_project_id str
    Specifies the enterprise project ID which the desired VPC belongs to.
    id str
    Specifies the id of the desired VPC.
    name str
    Specifies the name of the desired VPC. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_) and hyphens (-).
    status str
    Specifies the current status of the desired VPC. The value can be CREATING, OK or ERROR.
    tags Mapping[str, str]

    Specifies the included key/value pairs which associated with the desired VPC.

    A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique, use commas(,) to separate the multiple values. An empty for values indicates any value. The values are in the OR relationship.

    cidr String
    Specifies the cidr block of the desired VPC.
    description String
    Indicates the description of the VPC.
    enterpriseProjectId String
    Specifies the enterprise project ID which the desired VPC belongs to.
    id String
    Specifies the id of the desired VPC.
    name String
    Specifies the name of the desired VPC. The value is a string of no more than 64 characters and can contain digits, letters, underscores (_) and hyphens (-).
    status String
    Specifies the current status of the desired VPC. The value can be CREATING, OK or ERROR.
    tags Map<String>

    Specifies the included key/value pairs which associated with the desired VPC.

    A maximum of 10 tag keys are allowed for each query operation. Each tag key can have up to 10 tag values. The tag key cannot be left blank or set to an empty string. Each tag key must be unique, and each tag value in a tag must be unique, use commas(,) to separate the multiple values. An empty for values indicates any value. The values are in the OR relationship.

    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