Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add d/host #236

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions docs/data-sources/host.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "vcf_host Data Source - terraform-provider-vcf"
subcategory: ""
description: |-

---

# Data Source: vcf_host

The `vcf_host` data source provides information about an ESXi host in a VMware Cloud Foundation environment.

## Schema

### Required

- `fqdn` (String) - The fully qualified domain name of the ESXi host.

### Read-Only

- `id` (String) - The unique identifier of the ESXi host.
- `status` (String) - The status of the ESXi host.
- `version` (String) - The version of the ESXi running on the host.
- `compatible_storage_type` (String) - The compatible storage type of the ESXi host.

### Nested Schema for `hardware`

Read-Only:

- `vendor` (String) - The hardware vendor of the ESXi host.
- `model` (String) - The hardware model of the ESXi host.
- `hybrid` (Boolean) - The hybrid status of the hardware.

### Nested Schema for `network_pool`

Read-Only:

- `name` (String) - The name of the network pool.
- `id` (String) - The ID of the network pool.

### Nested Schema for `domain`

Read-Only:

- `id` (String) - The unique identifier of the domain.
- `name` (String) - The name of the domain.

### Nested Schema for `cluster`

Read-Only:

- `id` (String) - The unique identifier of the cluster.

### Nested Schema for `ip_addresses`

Read-Only:

- `ip_address` (String) - The IP address of the ESXi host.
- `type` (String) - The service type of the IP address.

### Nested Schema for `cpu`

Read-Only:

- `cores` (Number) - Number of CPU cores.
- `frequency_mhz` (Number) - Total CPU frequency in MHz.
- `used_frequency_mhz` (Number) - Used CPU frequency in MHz.
- `cpu_cores` (List of Object) - Information about each of the [CPU cores](#nestedobjatt--cpu--cpu_cores).

<a id="nestedobjatt--cpu--cpu_cores"></a>

#### Nested Schema for `cpu.cpu_cores`

Read-Only:

- `frequency` (Number) - The frequency of the CPU core in MHz.
- `manufacturer` (String) - The manufacturer of the CPU.
- `model` (String) - The model of the CPU.

### Nested Schema for `memory`

Read-Only:

- `total_capacity_mb` (Number) - The total memory capacity in MB.
- `used_capacity_mb` (Number) - The used memory capacity in MB.

### Nested Schema for `storage`

Read-Only:

- `total_capacity_mb` (Number) - The total storage capacity in MB.
- `used_capacity_mb` (Number) - The used storage capacity in MB.
- `disks` (List of Object) - The disks information of the ESXi host (see [below for nested schema](#nestedobjatt--storage--disks)).

<a id="nestedobjatt--storage--disks"></a>

### Nested Schema for `storage.disks`

Read-Only:

- `capacity_mb` (Number) - The capacity of the disk in MB.
- `disk_type` (String) - The type of the disk.
- `manufacturer` (String) - The manufacturer of the disk.
- `model` (String) - The model of the disk.

### Nested Schema for `physical_nics`

Read-Only:

- `device_name` (String) - The device name of the physical NIC.
- `mac_address` (String) - The MAC address of the physical NIC.
- `speed` (Number) - The speed of the physical NIC.
- `unit` (String) - The unit of the physical NIC speed.
22 changes: 22 additions & 0 deletions examples/data-sources/host/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
variable "sddc_manager_host" {
type = string
description = "The fully qualified domain name of the SDDC Manager instance."
}

variable "sddc_manager_username" {
type = string
description = "The username to authenticate to the SDDC Manager instance."
sensitive = true
}

variable "sddc_manager_password" {
type = string
description = "The password to authenticate to the SDDC Manager instance."
sensitive = true
}

variable "host_fqdn" {
type = string
description = "The fully qualified domain name of the ESXi host."
default = "sfo-w01-esx01.sfo.rainpole.io"
}
21 changes: 21 additions & 0 deletions examples/data-sources/host/vcf_host.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
terraform {
required_providers {
vcf = {
source = "vmware/vcf"
}
}
}

provider "vcf" {
sddc_manager_username = var.sddc_manager_username
sddc_manager_password = var.sddc_manager_password
sddc_manager_host = var.sddc_manager_host
}
tenthirtyam marked this conversation as resolved.
Show resolved Hide resolved

data "vcf_host" "example" {
fqdn = var.host_fqdn
}

output "host_id" {
value = data.vcf_host.example.id
}
Loading