1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. vmwareengine
  5. getSubnet
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.vmwareengine.getSubnet

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 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",
    });
    
    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")
    
    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
    	})
    }
    
    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 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
    

    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>
    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]
    func LookupSubnet(ctx *Context, args *LookupSubnetArgs, opts ...InvokeOption) (*LookupSubnetResult, error)
    func LookupSubnetOutput(ctx *Context, args *LookupSubnetOutputArgs, opts ...InvokeOption) LookupSubnetResultOutput

    > 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)
    }
    public static CompletableFuture<GetSubnetResult> getSubnet(GetSubnetArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:vmwareengine/getSubnet:getSubnet
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name 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 string
    The resource name of the private cloud that this subnet belongs.
    Name 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 string
    The resource name of the private cloud that this subnet belongs.
    name 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 String
    The resource name of the private cloud that this subnet belongs.
    name 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 string
    The resource name of the private cloud that this subnet belongs.
    name 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 str
    The resource name of the private cloud that this subnet belongs.
    name 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 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 string
    The first IP address of the range.
    LastAddress string
    The last IP address of the range.
    FirstAddress string
    The first IP address of the range.
    LastAddress string
    The last IP address of the range.
    firstAddress String
    The first IP address of the range.
    lastAddress String
    The last IP address of the range.
    firstAddress string
    The first IP address of the range.
    lastAddress string
    The last IP address of the range.
    first_address str
    The first IP address of the range.
    last_address str
    The last IP address of the range.
    firstAddress String
    The first IP address of the range.
    lastAddress 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.
    gcp logo
    Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi