Skip to content

Latest commit

 

History

History
87 lines (65 loc) · 1.42 KB

vsphere_host.md

File metadata and controls

87 lines (65 loc) · 1.42 KB

vsphere_host

back

Index

Terraform

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

top

Example Usage

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

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

top

Variables

variable "datacenter_id" {
  description = "(required) - The managed object ID of the datacenter to look for the host in."
  type        = string
}

variable "name" {
  description = "(optional) - The name of the host. This can be a name or path.\tIf not provided, the default host is used."
  type        = string
  default     = null
}

top

Datasource

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

top

Outputs

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

output "resource_pool_id" {
  description = "returns a string"
  value       = data.vsphere_host.this.resource_pool_id
}

output "this" {
  value = vsphere_host.this
}

top