1. Packages
  2. Packages
  3. Vsphere Provider
  4. API Docs
  5. getZone
Viewing docs for vSphere v4.17.0
published on Thursday, Jun 25, 2026 by Pulumi
vsphere logo
Viewing docs for vSphere v4.17.0
published on Thursday, Jun 25, 2026 by Pulumi

    The vsphere.Zone data source can be used to list the properties of a vSphere Zone including its associated compute clusters.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vsphere from "@pulumi/vsphere";
    
    const zone1 = vsphere.getZone({
        name: "zone-1",
    });
    
    import pulumi
    import pulumi_vsphere as vsphere
    
    zone1 = vsphere.get_zone(name="zone-1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vsphere.GetZone(ctx, &vsphere.LookupZoneArgs{
    			Name: "zone-1",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using VSphere = Pulumi.VSphere;
    
    return await Deployment.RunAsync(() => 
    {
        var zone1 = VSphere.GetZone.Invoke(new()
        {
            Name = "zone-1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vsphere.VsphereFunctions;
    import com.pulumi.vsphere.inputs.GetZoneArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 zone1 = VsphereFunctions.getZone(GetZoneArgs.builder()
                .name("zone-1")
                .build());
    
        }
    }
    
    variables:
      zone1:
        fn::invoke:
          function: vsphere:getZone
          arguments:
            name: zone-1
    
    pulumi {
      required_providers {
        vsphere = {
          source = "pulumi/vsphere"
        }
      }
    }
    
    data "vsphere_getzone" "zone1" {
      name = "zone-1"
    }
    

    Using getZone

    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 getZone(args: GetZoneArgs, opts?: InvokeOptions): Promise<GetZoneResult>
    function getZoneOutput(args: GetZoneOutputArgs, opts?: InvokeOptions): Output<GetZoneResult>
    def get_zone(name: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetZoneResult
    def get_zone_output(name: pulumi.Input[Optional[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetZoneResult]
    func LookupZone(ctx *Context, args *LookupZoneArgs, opts ...InvokeOption) (*LookupZoneResult, error)
    func LookupZoneOutput(ctx *Context, args *LookupZoneOutputArgs, opts ...InvokeOption) LookupZoneResultOutput

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

    public static class GetZone 
    {
        public static Task<GetZoneResult> InvokeAsync(GetZoneArgs args, InvokeOptions? opts = null)
        public static Output<GetZoneResult> Invoke(GetZoneInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetZoneResult> getZone(GetZoneArgs args, InvokeOptions options)
    public static Output<GetZoneResult> getZone(GetZoneArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vsphere:index/getZone:getZone
      arguments:
        # arguments dictionary
    data "vsphere_getzone" "name" {
        # arguments
    }

    The following arguments are supported:

    Name string
    The name of the vSphere Zone.
    Name string
    The name of the vSphere Zone.
    name string
    The name of the vSphere Zone.
    name String
    The name of the vSphere Zone.
    name string
    The name of the vSphere Zone.
    name str
    The name of the vSphere Zone.
    name String
    The name of the vSphere Zone.

    getZone Result

    The following output properties are available:

    ClusterIds List<string>
    The identifiers of the compute clusters (e.g., domain-c123) associated with this vSphere Zone.
    Description string
    The plain text description of the vSphere Zone.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The display name of the vSphere Zone. Matches the identifier of the resource.
    ClusterIds []string
    The identifiers of the compute clusters (e.g., domain-c123) associated with this vSphere Zone.
    Description string
    The plain text description of the vSphere Zone.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The display name of the vSphere Zone. Matches the identifier of the resource.
    cluster_ids list(string)
    The identifiers of the compute clusters (e.g., domain-c123) associated with this vSphere Zone.
    description string
    The plain text description of the vSphere Zone.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The display name of the vSphere Zone. Matches the identifier of the resource.
    clusterIds List<String>
    The identifiers of the compute clusters (e.g., domain-c123) associated with this vSphere Zone.
    description String
    The plain text description of the vSphere Zone.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The display name of the vSphere Zone. Matches the identifier of the resource.
    clusterIds string[]
    The identifiers of the compute clusters (e.g., domain-c123) associated with this vSphere Zone.
    description string
    The plain text description of the vSphere Zone.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The display name of the vSphere Zone. Matches the identifier of the resource.
    cluster_ids Sequence[str]
    The identifiers of the compute clusters (e.g., domain-c123) associated with this vSphere Zone.
    description str
    The plain text description of the vSphere Zone.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The display name of the vSphere Zone. Matches the identifier of the resource.
    clusterIds List<String>
    The identifiers of the compute clusters (e.g., domain-c123) associated with this vSphere Zone.
    description String
    The plain text description of the vSphere Zone.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The display name of the vSphere Zone. Matches the identifier of the resource.

    Package Details

    Repository
    vSphere pulumi/pulumi-vsphere
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vsphere Terraform Provider.
    vsphere logo
    Viewing docs for vSphere v4.17.0
    published on Thursday, Jun 25, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial