1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. vmwareengine
  5. getSubnet
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

gcp.vmwareengine.getSubnet

Explore with Pulumi AI

Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

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",
});
Copy
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")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  mySubnet:
    fn::invoke:
      function: gcp:vmwareengine:getSubnet
      arguments:
        name: service-1
        parent: project/my-project/locations/us-west1-a/privateClouds/my-cloud
Copy

Using getSubnet

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getSubnet(args: GetSubnetArgs, opts?: InvokeOptions): Promise<GetSubnetResult>
function getSubnetOutput(args: GetSubnetOutputArgs, opts?: InvokeOptions): Output<GetSubnetResult>
Copy
def get_subnet(name: Optional[str] = None,
               parent: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetSubnetResult
def get_subnet_output(name: Optional[pulumi.Input[str]] = None,
               parent: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetSubnetResult]
Copy
func LookupSubnet(ctx *Context, args *LookupSubnetArgs, opts ...InvokeOption) (*LookupSubnetResult, error)
func LookupSubnetOutput(ctx *Context, args *LookupSubnetOutputArgs, opts ...InvokeOption) LookupSubnetResultOutput
Copy

> Note: This function is named LookupSubnet in the Go SDK.

public static class GetSubnet 
{
    public static Task<GetSubnetResult> InvokeAsync(GetSubnetArgs args, InvokeOptions? opts = null)
    public static Output<GetSubnetResult> Invoke(GetSubnetInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSubnetResult> getSubnet(GetSubnetArgs args, InvokeOptions options)
public static Output<GetSubnetResult> getSubnet(GetSubnetArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:vmwareengine/getSubnet:getSubnet
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
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.
Parent This property is required. string
The resource name of the private cloud that this subnet belongs.
Name This property is required. string
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.
Parent This property is required. string
The resource name of the private cloud that this subnet belongs.
name This property is required. String
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.
parent This property is required. String
The resource name of the private cloud that this subnet belongs.
name This property is required. string
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.
parent This property is required. string
The resource name of the private cloud that this subnet belongs.
name This property is required. str
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.
parent This property is required. str
The resource name of the private cloud that this subnet belongs.
name This property is required. String
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.
parent This property is required. String
The resource name of the private cloud that this subnet belongs.

getSubnet Result

The following output properties are available:

CreateTime string
DhcpAddressRanges List<GetSubnetDhcpAddressRange>
GatewayId string
GatewayIp string
Id string
The provider-assigned unique ID for this managed resource.
IpCidrRange string
Name string
Parent string
StandardConfig bool
State string
Type string
Uid string
UpdateTime string
VlanId int
CreateTime string
DhcpAddressRanges []GetSubnetDhcpAddressRange
GatewayId string
GatewayIp string
Id string
The provider-assigned unique ID for this managed resource.
IpCidrRange string
Name string
Parent string
StandardConfig bool
State string
Type string
Uid string
UpdateTime string
VlanId int
createTime String
dhcpAddressRanges List<GetSubnetDhcpAddressRange>
gatewayId String
gatewayIp String
id String
The provider-assigned unique ID for this managed resource.
ipCidrRange String
name String
parent String
standardConfig Boolean
state String
type String
uid String
updateTime String
vlanId Integer
createTime string
dhcpAddressRanges GetSubnetDhcpAddressRange[]
gatewayId string
gatewayIp string
id string
The provider-assigned unique ID for this managed resource.
ipCidrRange string
name string
parent string
standardConfig boolean
state string
type string
uid string
updateTime string
vlanId number
create_time str
dhcp_address_ranges Sequence[GetSubnetDhcpAddressRange]
gateway_id str
gateway_ip str
id str
The provider-assigned unique ID for this managed resource.
ip_cidr_range str
name str
parent str
standard_config bool
state str
type str
uid str
update_time str
vlan_id int
createTime String
dhcpAddressRanges List<Property Map>
gatewayId String
gatewayIp String
id String
The provider-assigned unique ID for this managed resource.
ipCidrRange String
name String
parent String
standardConfig Boolean
state String
type String
uid String
updateTime String
vlanId Number

Supporting Types

GetSubnetDhcpAddressRange

FirstAddress This property is required. string
The first IP address of the range.
LastAddress This property is required. string
The last IP address of the range.
FirstAddress This property is required. string
The first IP address of the range.
LastAddress This property is required. string
The last IP address of the range.
firstAddress This property is required. String
The first IP address of the range.
lastAddress This property is required. String
The last IP address of the range.
firstAddress This property is required. string
The first IP address of the range.
lastAddress This property is required. string
The last IP address of the range.
first_address This property is required. str
The first IP address of the range.
last_address This property is required. str
The last IP address of the range.
firstAddress This property is required. String
The first IP address of the range.
lastAddress This property is required. String
The last IP address of the range.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi