getNetworks

This data source provides VPCs available to the user.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
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 vpcsDs = VpcFunctions.getNetworks(GetNetworksArgs.builder()
.cidrBlock("172.16.0.0/12")
.nameRegex("^foo")
.status("Available")
.build());
ctx.export("firstVpcId", vpcsDs.applyValue(getNetworksResult -> getNetworksResult.vpcs()[0].id()));
}
}

Return

A collection of values returned by getNetworks.

Parameters

argument

A collection of arguments for invoking getNetworks.


suspend fun getNetworks(cidrBlock: String? = null, dhcpOptionsSetId: String? = null, dryRun: Boolean? = null, enableDetails: Boolean? = null, ids: List<String>? = null, isDefault: Boolean? = null, nameRegex: String? = null, outputFile: String? = null, pageNumber: Int? = null, pageSize: Int? = null, resourceGroupId: String? = null, status: String? = null, tags: Map<String, Any>? = null, vpcName: String? = null, vpcOwnerId: Int? = null, vswitchId: String? = null): GetNetworksResult

Return

A collection of values returned by getNetworks.

See also

Parameters

cidrBlock

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

dhcpOptionsSetId

The ID of dhcp options set.

dryRun

Indicates whether to check this request only. Valid values: true and false.

enableDetails

Default to true. Set it to true can output the route_table_id.

ids

A list of VPC IDs.

isDefault

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

nameRegex

A regex string to filter VPCs by name.

outputFile
pageNumber
pageSize
resourceGroupId

The Id of resource group which VPC belongs.

status

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

tags

A mapping of tags to assign to the resource.

vpcName

The name of the VPC.

vpcOwnerId

The owner ID of VPC.

vswitchId

Filter results by the specified VSwitch.


suspend fun getNetworks(argument: suspend GetNetworksPlainArgsBuilder.() -> Unit): GetNetworksResult

Return

A collection of values returned by getNetworks.

See also

Parameters

argument

Builder for com.pulumi.alicloud.vpc.kotlin.inputs.GetNetworksPlainArgs.