published on Thursday, Jun 25, 2026 by Pulumi
published on Thursday, Jun 25, 2026 by Pulumi
The vsphere.Zone resource can be used to create a vSphere Zone and associate it with one or more
compute clusters.
**NOTE:**vSphere Zones are available in vSphere 8. This resource requires vSphere 8 and later.
Example Usage
Create a zone without associating it with any compute clusters
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const zone1 = new vsphere.Zone("zone1", {
name: "zone-1",
description: "a sample zone",
});
import pulumi
import pulumi_vsphere as vsphere
zone1 = vsphere.Zone("zone1",
name="zone-1",
description="a sample zone")
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.NewZone(ctx, "zone1", &vsphere.ZoneArgs{
Name: pulumi.String("zone-1"),
Description: pulumi.String("a sample zone"),
})
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 = new VSphere.Zone("zone1", new()
{
Name = "zone-1",
Description = "a sample zone",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vsphere.Zone;
import com.pulumi.vsphere.ZoneArgs;
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) {
var zone1 = new Zone("zone1", ZoneArgs.builder()
.name("zone-1")
.description("a sample zone")
.build());
}
}
resources:
zone1:
type: vsphere:Zone
properties:
name: zone-1
description: a sample zone
pulumi {
required_providers {
vsphere = {
source = "pulumi/vsphere"
}
}
}
resource "vsphere_zone" "zone1" {
name = "zone-1"
description = "a sample zone"
}
Create a Zone and Associate it with a Compute Cluster
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const datacenter = vsphere.getDatacenter({
name: "dc-01",
});
const cluster = datacenter.then(datacenter => vsphere.getComputeCluster({
name: "cluster-01",
datacenterId: datacenter.id,
}));
const zone1 = new vsphere.Zone("zone1", {
name: "zone-1",
description: "a sample zone",
clusterIds: [cluster.then(cluster => cluster.id)],
});
import pulumi
import pulumi_vsphere as vsphere
datacenter = vsphere.get_datacenter(name="dc-01")
cluster = vsphere.get_compute_cluster(name="cluster-01",
datacenter_id=datacenter.id)
zone1 = vsphere.Zone("zone1",
name="zone-1",
description="a sample zone",
cluster_ids=[cluster.id])
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 {
datacenter, err := vsphere.GetDatacenter(ctx, &vsphere.LookupDatacenterArgs{
Name: pulumi.StringRef("dc-01"),
}, nil)
if err != nil {
return err
}
cluster, err := vsphere.GetComputeCluster(ctx, &vsphere.LookupComputeClusterArgs{
Name: "cluster-01",
DatacenterId: pulumi.StringRef(datacenter.Id),
}, nil)
if err != nil {
return err
}
_, err = vsphere.NewZone(ctx, "zone1", &vsphere.ZoneArgs{
Name: pulumi.String("zone-1"),
Description: pulumi.String("a sample zone"),
ClusterIds: pulumi.StringArray{
pulumi.String(cluster.Id),
},
})
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 datacenter = VSphere.GetDatacenter.Invoke(new()
{
Name = "dc-01",
});
var cluster = VSphere.GetComputeCluster.Invoke(new()
{
Name = "cluster-01",
DatacenterId = datacenter.Apply(getDatacenterResult => getDatacenterResult.Id),
});
var zone1 = new VSphere.Zone("zone1", new()
{
Name = "zone-1",
Description = "a sample zone",
ClusterIds = new[]
{
cluster.Apply(getComputeClusterResult => getComputeClusterResult.Id),
},
});
});
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.GetDatacenterArgs;
import com.pulumi.vsphere.inputs.GetComputeClusterArgs;
import com.pulumi.vsphere.Zone;
import com.pulumi.vsphere.ZoneArgs;
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 datacenter = VsphereFunctions.getDatacenter(GetDatacenterArgs.builder()
.name("dc-01")
.build());
final var cluster = VsphereFunctions.getComputeCluster(GetComputeClusterArgs.builder()
.name("cluster-01")
.datacenterId(datacenter.id())
.build());
var zone1 = new Zone("zone1", ZoneArgs.builder()
.name("zone-1")
.description("a sample zone")
.clusterIds(cluster.id())
.build());
}
}
resources:
zone1:
type: vsphere:Zone
properties:
name: zone-1
description: a sample zone
clusterIds:
- ${cluster.id}
variables:
datacenter:
fn::invoke:
function: vsphere:getDatacenter
arguments:
name: dc-01
cluster:
fn::invoke:
function: vsphere:getComputeCluster
arguments:
name: cluster-01
datacenterId: ${datacenter.id}
pulumi {
required_providers {
vsphere = {
source = "pulumi/vsphere"
}
}
}
data "vsphere_getdatacenter" "datacenter" {
name = "dc-01"
}
data "vsphere_getcomputecluster" "cluster" {
name = "cluster-01"
datacenter_id = data.vsphere_getdatacenter.datacenter.id
}
resource "vsphere_zone" "zone1" {
name = "zone-1"
description = "a sample zone"
cluster_ids = [data.vsphere_getcomputecluster.cluster.id]
}
Create Zone Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Zone(name: string, args?: ZoneArgs, opts?: CustomResourceOptions);@overload
def Zone(resource_name: str,
args: Optional[ZoneArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Zone(resource_name: str,
opts: Optional[ResourceOptions] = None,
cluster_ids: Optional[Sequence[str]] = None,
description: Optional[str] = None,
name: Optional[str] = None)func NewZone(ctx *Context, name string, args *ZoneArgs, opts ...ResourceOption) (*Zone, error)public Zone(string name, ZoneArgs? args = null, CustomResourceOptions? opts = null)type: vsphere:Zone
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "vsphere_zone" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ZoneArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ZoneArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ZoneArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ZoneArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ZoneArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var zoneResource = new VSphere.Zone("zoneResource", new()
{
ClusterIds = new[]
{
"string",
},
Description = "string",
Name = "string",
});
example, err := vsphere.NewZone(ctx, "zoneResource", &vsphere.ZoneArgs{
ClusterIds: pulumi.StringArray{
pulumi.String("string"),
},
Description: pulumi.String("string"),
Name: pulumi.String("string"),
})
resource "vsphere_zone" "zoneResource" {
cluster_ids = ["string"]
description = "string"
name = "string"
}
var zoneResource = new Zone("zoneResource", ZoneArgs.builder()
.clusterIds("string")
.description("string")
.name("string")
.build());
zone_resource = vsphere.Zone("zoneResource",
cluster_ids=["string"],
description="string",
name="string")
const zoneResource = new vsphere.Zone("zoneResource", {
clusterIds: ["string"],
description: "string",
name: "string",
});
type: vsphere:Zone
properties:
clusterIds:
- string
description: string
name: string
Zone Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Zone resource accepts the following input properties:
- Cluster
Ids List<string> - The identifiers of the compute clusters (e.g.,
domain-c123) to associate with this vSphere Zone. - Description string
- The plain text description of the vSphere Zone.
- Name string
- The display name of the vSphere Zone. Matches the identifier of the resource.
- Cluster
Ids []string - The identifiers of the compute clusters (e.g.,
domain-c123) to associate with this vSphere Zone. - Description string
- The plain text description of the vSphere Zone.
- 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) to associate with this vSphere Zone. - description string
- The plain text description of the vSphere Zone.
- 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) to associate with this vSphere Zone. - description String
- The plain text description of the vSphere Zone.
- name String
- The display name of the vSphere Zone. Matches the identifier of the resource.
- cluster
Ids string[] - The identifiers of the compute clusters (e.g.,
domain-c123) to associate with this vSphere Zone. - description string
- The plain text description of the vSphere Zone.
- 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) to associate with this vSphere Zone. - description str
- The plain text description of the vSphere Zone.
- name str
- 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) to associate with this vSphere Zone. - description String
- The plain text description of the vSphere Zone.
- name String
- The display name of the vSphere Zone. Matches the identifier of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the Zone resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Zone Resource
Get an existing Zone resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ZoneState, opts?: CustomResourceOptions): Zone@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster_ids: Optional[Sequence[str]] = None,
description: Optional[str] = None,
name: Optional[str] = None) -> Zonefunc GetZone(ctx *Context, name string, id IDInput, state *ZoneState, opts ...ResourceOption) (*Zone, error)public static Zone Get(string name, Input<string> id, ZoneState? state, CustomResourceOptions? opts = null)public static Zone get(String name, Output<String> id, ZoneState state, CustomResourceOptions options)resources: _: type: vsphere:Zone get: id: ${id}import {
to = vsphere_zone.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Cluster
Ids List<string> - The identifiers of the compute clusters (e.g.,
domain-c123) to associate with this vSphere Zone. - Description string
- The plain text description of the vSphere Zone.
- Name string
- The display name of the vSphere Zone. Matches the identifier of the resource.
- Cluster
Ids []string - The identifiers of the compute clusters (e.g.,
domain-c123) to associate with this vSphere Zone. - Description string
- The plain text description of the vSphere Zone.
- 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) to associate with this vSphere Zone. - description string
- The plain text description of the vSphere Zone.
- 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) to associate with this vSphere Zone. - description String
- The plain text description of the vSphere Zone.
- name String
- The display name of the vSphere Zone. Matches the identifier of the resource.
- cluster
Ids string[] - The identifiers of the compute clusters (e.g.,
domain-c123) to associate with this vSphere Zone. - description string
- The plain text description of the vSphere Zone.
- 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) to associate with this vSphere Zone. - description str
- The plain text description of the vSphere Zone.
- name str
- 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) to associate with this vSphere Zone. - description String
- The plain text description of the vSphere Zone.
- 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
vsphereTerraform Provider.
published on Thursday, Jun 25, 2026 by Pulumi