GetNetworks

This data source provides VPCs available to the user.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var vpcsDs = Output.Create(AliCloud.Vpc.GetNetworks.InvokeAsync(new AliCloud.Vpc.GetNetworksArgs
        {
            CidrBlock = "172.16.0.0/12",
            NameRegex = "^foo",
            Status = "Available",
        }));
        this.FirstVpcId = vpcsDs.Apply(vpcsDs => vpcsDs.Vpcs[0].Id);
    }

    [Output("firstVpcId")]
    public Output<string> FirstVpcId { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

vpcs_ds = alicloud.vpc.get_networks(cidr_block="172.16.0.0/12",
    name_regex="^foo",
    status="Available")
pulumi.export("firstVpcId", vpcs_ds.vpcs[0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const vpcsDs = pulumi.output(alicloud.vpc.getNetworks({
    cidrBlock: "172.16.0.0/12",
    nameRegex: "^foo",
    status: "Available",
}, { async: true }));

export const firstVpcId = vpcsDs.vpcs[0].id;

Using GetNetworks

function getNetworks(args: GetNetworksArgs, opts?: InvokeOptions): Promise<GetNetworksResult>
function  get_networks(cidr_block=None, ids=None, is_default=None, name_regex=None, output_file=None, resource_group_id=None, status=None, tags=None, vswitch_id=None, opts=None)
func GetNetworks(ctx *Context, args *GetNetworksArgs, opts ...InvokeOption) (*GetNetworksResult, error)
public static class GetNetworks {
    public static Task<GetNetworksResult> InvokeAsync(GetNetworksArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

CidrBlock string

Filter results by a specific CIDR block. For example: “172.16.0.0/12”.

Ids List<string>

A list of VPC IDs.

IsDefault bool

Indicate whether the VPC is the default one in the specified region.

NameRegex string

A regex string to filter VPCs by name.

OutputFile string
ResourceGroupId string

The Id of resource group which VPC belongs.

Status string

Filter results by a specific status. Valid value are Pending and Available.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

VswitchId string

Filter results by the specified VSwitch.

CidrBlock string

Filter results by a specific CIDR block. For example: “172.16.0.0/12”.

Ids []string

A list of VPC IDs.

IsDefault bool

Indicate whether the VPC is the default one in the specified region.

NameRegex string

A regex string to filter VPCs by name.

OutputFile string
ResourceGroupId string

The Id of resource group which VPC belongs.

Status string

Filter results by a specific status. Valid value are Pending and Available.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

VswitchId string

Filter results by the specified VSwitch.

cidrBlock string

Filter results by a specific CIDR block. For example: “172.16.0.0/12”.

ids string[]

A list of VPC IDs.

isDefault boolean

Indicate whether the VPC is the default one in the specified region.

nameRegex string

A regex string to filter VPCs by name.

outputFile string
resourceGroupId string

The Id of resource group which VPC belongs.

status string

Filter results by a specific status. Valid value are Pending and Available.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

vswitchId string

Filter results by the specified VSwitch.

cidr_block str

Filter results by a specific CIDR block. For example: “172.16.0.0/12”.

ids List[str]

A list of VPC IDs.

is_default bool

Indicate whether the VPC is the default one in the specified region.

name_regex str

A regex string to filter VPCs by name.

output_file str
resource_group_id str

The Id of resource group which VPC belongs.

status str

Filter results by a specific status. Valid value are Pending and Available.

tags Dict[str, Any]

A mapping of tags to assign to the resource.

vswitch_id str

Filter results by the specified VSwitch.

GetNetworks Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of VPC IDs.

Names List<string>

A list of VPC names.

Vpcs List<Pulumi.AliCloud.Vpc.Outputs.GetNetworksVpc>

A list of VPCs. Each element contains the following attributes:

CidrBlock string

CIDR block of the VPC.

IsDefault bool

Whether the VPC is the default VPC in the region.

NameRegex string
OutputFile string
ResourceGroupId string
Status string

Status of the VPC.

Tags Dictionary<string, object>

A map of tags assigned to the VPC.

VswitchId string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of VPC IDs.

Names []string

A list of VPC names.

Vpcs []GetNetworksVpc

A list of VPCs. Each element contains the following attributes:

CidrBlock string

CIDR block of the VPC.

IsDefault bool

Whether the VPC is the default VPC in the region.

NameRegex string
OutputFile string
ResourceGroupId string
Status string

Status of the VPC.

Tags map[string]interface{}

A map of tags assigned to the VPC.

VswitchId string
id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of VPC IDs.

names string[]

A list of VPC names.

vpcs GetNetworksVpc[]

A list of VPCs. Each element contains the following attributes:

cidrBlock string

CIDR block of the VPC.

isDefault boolean

Whether the VPC is the default VPC in the region.

nameRegex string
outputFile string
resourceGroupId string
status string

Status of the VPC.

tags {[key: string]: any}

A map of tags assigned to the VPC.

vswitchId string
id str

The provider-assigned unique ID for this managed resource.

ids List[str]

A list of VPC IDs.

names List[str]

A list of VPC names.

vpcs List[GetNetworksVpc]

A list of VPCs. Each element contains the following attributes:

cidr_block str

CIDR block of the VPC.

is_default bool

Whether the VPC is the default VPC in the region.

name_regex str
output_file str
resource_group_id str
status str

Status of the VPC.

tags Dict[str, Any]

A map of tags assigned to the VPC.

vswitch_id str

Supporting Types

GetNetworksVpc

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

CidrBlock string

Filter results by a specific CIDR block. For example: “172.16.0.0/12”.

CreationTime string

Time of creation.

Description string

Description of the VPC

Id string

ID of the VPC.

IsDefault bool

Indicate whether the VPC is the default one in the specified region.

RegionId string

ID of the region where the VPC is located.

RouteTableId string

Route table ID of the VRouter.

Status string

Filter results by a specific status. Valid value are Pending and Available.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

VpcName string

Name of the VPC.

VrouterId string

ID of the VRouter.

VswitchIds List<string>

List of VSwitch IDs in the specified VPC

CidrBlock string

Filter results by a specific CIDR block. For example: “172.16.0.0/12”.

CreationTime string

Time of creation.

Description string

Description of the VPC

Id string

ID of the VPC.

IsDefault bool

Indicate whether the VPC is the default one in the specified region.

RegionId string

ID of the region where the VPC is located.

RouteTableId string

Route table ID of the VRouter.

Status string

Filter results by a specific status. Valid value are Pending and Available.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

VpcName string

Name of the VPC.

VrouterId string

ID of the VRouter.

VswitchIds []string

List of VSwitch IDs in the specified VPC

cidrBlock string

Filter results by a specific CIDR block. For example: “172.16.0.0/12”.

creationTime string

Time of creation.

description string

Description of the VPC

id string

ID of the VPC.

isDefault boolean

Indicate whether the VPC is the default one in the specified region.

regionId string

ID of the region where the VPC is located.

routeTableId string

Route table ID of the VRouter.

status string

Filter results by a specific status. Valid value are Pending and Available.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

vpcName string

Name of the VPC.

vrouterId string

ID of the VRouter.

vswitchIds string[]

List of VSwitch IDs in the specified VPC

cidr_block str

Filter results by a specific CIDR block. For example: “172.16.0.0/12”.

creation_time str

Time of creation.

description str

Description of the VPC

id str

ID of the VPC.

is_default bool

Indicate whether the VPC is the default one in the specified region.

regionId str

ID of the region where the VPC is located.

route_table_id str

Route table ID of the VRouter.

status str

Filter results by a specific status. Valid value are Pending and Available.

tags Dict[str, Any]

A mapping of tags to assign to the resource.

vpc_name str

Name of the VPC.

vrouterId str

ID of the VRouter.

vswitch_ids List[str]

List of VSwitch IDs in the specified VPC

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.