» vsphere_datacenter
Provides a VMware vSphere datacenter resource. This can be used as the primary container of inventory objects such as hosts and virtual machines.
» Example Usages
Create datacenter on the root folder:
resource "vsphere_datacenter" "prod_datacenter" {
name = "my_prod_datacenter"
}
Create datacenter on a subfolder:
resource "vsphere_datacenter" "research_datacenter" {
name = "my_research_datacenter"
folder = "/research/"
}
» Argument Reference
The following arguments are supported:
-
name
- (Required) The name of the datacenter. This name needs to be unique within the folder. Forces a new resource if changed. -
folder
- (Optional) The folder where the datacenter should be created. Forces a new resource if changed. -
tags
- (Optional) The IDs of any tags to attach to this resource. See here for a reference on how to apply tags.
NOTE: Tagging support is unsupported on direct ESXi connections and requires vCenter 6.0 or higher.
-
custom_attributes
- (Optional) Map of custom attribute ids to value strings to set for datacenter resource. See here for a reference on how to set values for custom attributes.
NOTE: Custom attributes are unsupported on direct ESXi connections and require vCenter.
» Attribute Reference
-
id
- The name of this datacenter. This will be changed to the managed object ID in v2.0. -
moid
- Managed object ID of this datacenter.