get Subnet
Use this data source to get details about a subnet. Management subnets support only read operations and should be configured through this data source. User defined subnets can be configured using the resource as well as the datasource. To get more information about private cloud subnet, see:
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const mySubnet = gcp.vmwareengine.getSubnet({
name: "service-1",
parent: "project/my-project/locations/us-west1-a/privateClouds/my-cloud",
});
import pulumi
import pulumi_gcp as gcp
my_subnet = gcp.vmwareengine.get_subnet(name="service-1",
parent="project/my-project/locations/us-west1-a/privateClouds/my-cloud")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var mySubnet = Gcp.VMwareEngine.GetSubnet.Invoke(new()
{
Name = "service-1",
Parent = "project/my-project/locations/us-west1-a/privateClouds/my-cloud",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/vmwareengine"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vmwareengine.LookupSubnet(ctx, &vmwareengine.LookupSubnetArgs{
Name: "service-1",
Parent: "project/my-project/locations/us-west1-a/privateClouds/my-cloud",
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.vmwareengine.VmwareengineFunctions;
import com.pulumi.gcp.vmwareengine.inputs.GetSubnetArgs;
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 mySubnet = VmwareengineFunctions.getSubnet(GetSubnetArgs.builder()
.name("service-1")
.parent("project/my-project/locations/us-west1-a/privateClouds/my-cloud")
.build());
}
}
variables:
mySubnet:
fn::invoke:
Function: gcp:vmwareengine:getSubnet
Arguments:
name: service-1
parent: project/my-project/locations/us-west1-a/privateClouds/my-cloud
Return
A collection of values returned by getSubnet.
Parameters
A collection of arguments for invoking getSubnet.
Return
A collection of values returned by getSubnet.
Parameters
Name of the resource. UserDefined subnets are named in the format of "service-n", where n ranges from 1 to 5. Management subnets have arbitary names including "vmotion", "vsan", "system-management" etc. More details about subnet names can be found on the cloud console.
The resource name of the private cloud that this subnet belongs.
See also
Return
A collection of values returned by getSubnet.
Parameters
Builder for com.pulumi.gcp.vmwareengine.kotlin.inputs.GetSubnetPlainArgs.