Skip to content

Latest commit

 

History

History
82 lines (61 loc) · 1.37 KB

vsphere_datastore.md

File metadata and controls

82 lines (61 loc) · 1.37 KB

vsphere_datastore

back

Index

Terraform

terraform {
  required_providers {
    vsphere = ">= 1.25.0"
  }
}

top

Example Usage

module "vsphere_datastore" {
  source = "./modules/vsphere/d/vsphere_datastore"

  # datacenter_id - (optional) is a type of string
  datacenter_id = null
  # name - (required) is a type of string
  name = null
}

top

Variables

variable "datacenter_id" {
  description = "(optional) - The managed object ID of the datacenter the datastore is in. This is not required when using ESXi directly, or if there is only one datacenter in your infrastructure."
  type        = string
  default     = null
}

variable "name" {
  description = "(required) - The name or path of the datastore."
  type        = string
}

top

Datasource

data "vsphere_datastore" "this" {
  # datacenter_id - (optional) is a type of string
  datacenter_id = var.datacenter_id
  # name - (required) is a type of string
  name = var.name
}

top

Outputs

output "id" {
  description = "returns a string"
  value       = data.vsphere_datastore.this.id
}

output "this" {
  value = vsphere_datastore.this
}

top