» vsphere_datacenter

The vsphere_datacenter data source can be used to discover the ID of a vSphere datacenter. This can then be used with resources or data sources that require a datacenter, such as the vsphere_host data source.

» Example Usage

data "vsphere_datacenter" "datacenter" {
  name = "dc1"
}

» Argument Reference

The following arguments are supported:

  • name - (Optional) The name of the datacenter. This can be a name or path. Can be omitted if there is only one datacenter in your inventory.

» Attribute Reference

The only exported attribute is id, which is the managed object ID of this datacenter.