getSubnetwork

Get a subnetwork within GCE from its name and region.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetSubnetworkArgs;
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 my-subnetwork = ComputeFunctions.getSubnetwork(GetSubnetworkArgs.builder()
.name("default-us-east1")
.region("us-east1")
.build());
}
}

Return

A collection of values returned by getSubnetwork.

Parameters

argument

A collection of arguments for invoking getSubnetwork.


suspend fun getSubnetwork(name: String? = null, project: String? = null, region: String? = null, selfLink: String? = null): GetSubnetworkResult

Return

A collection of values returned by getSubnetwork.

Parameters

name

The name of the subnetwork. One of name or self_link must be specified.

project

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

region

The region this subnetwork has been created in. If unspecified, this defaults to the region configured in the provider.

selfLink

The self link of the subnetwork. If self_link is specified, name, project, and region are ignored.

See also


Return

A collection of values returned by getSubnetwork.

Parameters

argument

Builder for com.pulumi.gcp.compute.kotlin.inputs.GetSubnetworkPlainArgs.

See also