get Subnetworks
Get subnetworks within GCE. See the official documentation and API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const my_subnetworks = gcp.compute.getSubnetworks({
filter: "ipCidrRange eq 192.168.178.0/24",
project: "my-project",
region: "us-east1",
});
Content copied to clipboard
import pulumi
import pulumi_gcp as gcp
my_subnetworks = gcp.compute.get_subnetworks(filter="ipCidrRange eq 192.168.178.0/24",
project="my-project",
region="us-east1")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var my_subnetworks = Gcp.Compute.GetSubnetworks.Invoke(new()
{
Filter = "ipCidrRange eq 192.168.178.0/24",
Project = "my-project",
Region = "us-east1",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.GetSubnetworks(ctx, &compute.GetSubnetworksArgs{
Filter: pulumi.StringRef("ipCidrRange eq 192.168.178.0/24"),
Project: pulumi.StringRef("my-project"),
Region: pulumi.StringRef("us-east1"),
}, nil)
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
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.GetSubnetworksArgs;
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-subnetworks = ComputeFunctions.getSubnetworks(GetSubnetworksArgs.builder()
.filter("ipCidrRange eq 192.168.178.0/24")
.project("my-project")
.region("us-east1")
.build());
}
}
Content copied to clipboard
variables:
my-subnetworks:
fn::invoke:
function: gcp:compute:getSubnetworks
arguments:
filter: ipCidrRange eq 192.168.178.0/24
project: my-project
region: us-east1
Content copied to clipboard
Return
A collection of values returned by getSubnetworks.
Parameters
argument
A collection of arguments for invoking getSubnetworks.
suspend fun getSubnetworks(filter: String? = null, project: String? = null, region: String? = null): GetSubnetworksResult
Return
A collection of values returned by getSubnetworks.
Parameters
filter
A string filter as defined in the REST API.
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.
See also
suspend fun getSubnetworks(argument: suspend GetSubnetworksPlainArgsBuilder.() -> Unit): GetSubnetworksResult
Return
A collection of values returned by getSubnetworks.
Parameters
argument
Builder for com.pulumi.gcp.compute.kotlin.inputs.GetSubnetworksPlainArgs.