# Basic example If deployed with the default values, this example will create a [content library](https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-vm-administration/GUID-254B2CE8-20A8-43F0-90E8-3F6776C2C896.html) named `example-content-library` backed by a [datastore](https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-storage/GUID-7BED10DD-3EF2-4670-BA7F-0EEB4EC6EB85.html) named `WorkloadDatastore`, and one ISO [item](https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-vm-administration/GUID-D3DD122F-16A5-4F36-8467-97994A854B16.html) named `vmware-tools-windows-11.3.0-18` in your [VMware Cloud on AWS](https://aws.amazon.com/vmware/) or [VMware vSphere](https://docs.vmware.com/en/VMware-vSphere/index.html) on‑premises environment. ## Usage ### Configure the provider One way to configure the VMware vSphere provider is with [environment variables](https://registry.terraform.io/providers/hashicorp/vsphere/latest/docs#argument-reference), for example: * Required * `VSPHERE_USER`: Username for vSphere API operations. * `VSPHERE_PASSWORD`: Password for vSphere API operations. * `VSPHERE_SERVER`: vCenter Server fully qualified domain name (FQDN) or IP address for vSphere API operations. * Optional * `VSPHERE_ALLOW_UNVERIFIED_SSL`: Boolean that can be set to `true` to disable TLS certificate verification. This should be used with care as it could allow an attacker to intercept your auth token. If omitted, the default value is `false`. ### Configure the input variables All of the variables in this example have default values, but if you would like to override any of these, one way to do so is to create a [`terraform.tfvars` variable definition file](https://www.terraform.io/language/values/variables#variable-definitions-tfvars-files) in this directory. #### Example `terraform.tfvars` ```hcl content_library_name = "Content library" ``` ### Deploy To deploy this example, execute the following: 1/ [`terraform init`](https://www.terraform.io/cli/commands/init), 2/ [`terraform plan`](https://www.terraform.io/cli/commands/plan), and 3/ [`terraform apply`](https://www.terraform.io/cli/commands/apply). ### Clean-up When you want to remove the resources, execute the following: [`terraform destroy`](https://www.terraform.io/cli/commands/destroy). ## Requirements | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.1.0 | | [vsphere](#requirement\_vsphere) | >= 2.1.0 | ## Providers No providers. ## Modules | Name | Source | Version | |------|--------|---------| | [vsphere\_content\_library](#module\_vsphere\_content\_library) | aws-ia/content-library/vsphere | >= 0.0.1 | ## Resources No resources. ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [content\_library\_description](#input\_content\_library\_description) | The description of the vSphere content library. | `string` | `null` | no | | [content\_library\_items](#input\_content\_library\_items) | List of maps of strings defining either OVA/OVF or ISO vSphere content library items (https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-D3DD122F-16A5-4F36-8467-97994A854B16.html). At this time, VM template items are not supported by this module, but can be easily added separately. Each map must have the following keys: 'name', 'description', 'file\_url', and 'type'. The value for each 'type' key must be set to either 'ovf' or 'iso'. Last, only the value for 'description' can be empty. | `list(map(string))` |
[| no | | [content\_library\_name](#input\_content\_library\_name) | The name of the vSphere content library (https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-254B2CE8-20A8-43F0-90E8-3F6776C2C896.html?hWord=N4IghgNiBcIMYHsB2AXApqgBBAlgIwCcwCBPEAXyA). | `string` | `"example-content-library"` | no | | [create\_content\_library](#input\_create\_content\_library) | If true, a new vSphere content library will be created; otherwise, the corresponding content library will be imported as a data source. | `bool` | `true` | no | | [create\_content\_library\_items](#input\_create\_content\_library\_items) | If true, new vSphere content library items will be created for each specified; otherwise, the corresponding content library items will be imported as a data source. | `bool` | `true` | no | | [datacenter\_name](#input\_datacenter\_name) | The name of the vSphere datacenter object where the content library will be created (https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vcenterhost.doc/GUID-7FDFBDBE-F8AC-4D00-AE5E-3F14D7472FAF.html). | `string` | `"SDDC-Datacenter"` | no | | [datastore\_name](#input\_datastore\_name) | The name of the vSphere datastore object where the content library items will be stored (https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.storage.doc/GUID-7BED10DD-3EF2-4670-BA7F-0EEB4EC6EB85.html). | `string` | `"WorkloadDatastore"` | no | ## Outputs | Name | Description | |------|-------------| | [content\_library](#output\_content\_library) | The vSphere content library. | | [items](#output\_items) | The list of vSphere content library items. |
{
"description": "VMware Tools for Windows.",
"file_url": "https://packages.vmware.com/tools/esx/8.0/windows/VMware-tools-windows-12.0.6-20104755.iso",
"name": "vmware-tools-windows-12.0.6-20",
"type": "iso"
}
]