get Networks
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
A collection of arguments for invoking getNetworks.
Return
A collection of values returned by getNetworks.
See also
Parameters
Filter results by a specific CIDR block. For example: "172.16.0.0/12".
The ID of dhcp options set.
Indicates whether to check this request only. Valid values: true
and false
.
Default to true
. Set it to true can output the route_table_id
.
A list of VPC IDs.
Indicate whether the VPC is the default one in the specified region.
A regex string to filter VPCs by name.
File name where to save data source results (after running pulumi preview
).
The Id of resource group which VPC belongs.
Filter results by a specific status. Valid value are Pending
and Available
.
A mapping of tags to assign to the resource.
The name of the VPC.
The owner ID of VPC.
Filter results by the specified VSwitch.
Return
A collection of values returned by getNetworks.
See also
Parameters
Builder for com.pulumi.alicloud.vpc.kotlin.inputs.GetNetworksPlainArgs.