This Terraform module creates or imports a datastore‑backed content library in your VMware Cloud on AWS or VMware vSphere on‑premises environment. You can configure the content library as one of three types: standalone, publisher, or subscriber.
You can optionally specify a list of new items, such as OVA and ISO images, to deploy into the new or existing content library or a list of items to import from an existing content library.
module "vsphere_content_library" {
source = "aws-ia/content-library/vsphere"
version = ">= 1.0.0"
datacenter_name = "SDDC-Datacenter"
datastore_name = "WorkloadDatastore"
content_library_name = "example-content-library"
content_library_description = "Example content library."
create_content_library = true
}
module "vsphere_content_library" {
source = "aws-ia/content-library/vsphere"
version = ">= 1.0.0"
datacenter_name = "SDDC-Datacenter"
datastore_name = "WorkloadDatastore"
content_library_name = "example-content-library"
content_library_description = "Example content library."
create_content_library = true
create_content_library_items = true
content_library_items = [
{
name = "vmware-tools-windows-12.0.6-20"
description = "VMware Tools for Windows."
file_url = "https://packages.vmware.com/tools/esx/8.0/windows/VMware-tools-windows-12.0.6-20104755.iso"
type = "iso"
},
]
}
module "vsphere_content_library" {
source = "aws-ia/content-library/vsphere"
version = ">= 1.0.0"
content_library_name = "example-content-library"
create_content_library = false
create_content_library_items = true
content_library_items = [
{
name = "vmware-tools-windows-12.0.6-20"
description = "VMware Tools for Windows."
file_url = "https://packages.vmware.com/tools/esx/8.0/windows/VMware-tools-windows-12.0.6-20104755.iso"
type = "iso"
},
]
}
module "vsphere_content_library" {
source = "aws-ia/content-library/vsphere"
version = ">= 1.0.0"
content_library_name = "example-content-library"
create_content_library = false
create_content_library_items = false
content_library_items = [
{
name = "vmware-tools-windows-12.0.6-20"
description = ""
file_url = "n/a"
type = "iso"
},
]
}
module "vsphere_content_library" {
source = "aws-ia/content-library/vsphere"
version = ">= 1.0.0"
content_library_name = "example-publisher"
create_content_library = true
authentication_method = "BASIC"
password = var.password
publication_published = true
}
module "vsphere_content_library" {
source = "aws-ia/content-library/vsphere"
version = ">= 1.0.0"
content_library_name = "example-subscriber"
create_content_library = true
subscription_url = "https://vcenter.sddc-127-0-0-1.vmwarevmc.com:443/cls/vcsp/lib/60d8b31e-c6d0-47d7-9758-ff0f4ff5af14/lib.json"
authentication_method = "BASIC"
password = var.password
subscription_automatic_sync = true
subscription_on_demand = false
}
Name | Version |
---|---|
terraform | >= 1.1.0 |
vsphere | >= 2.1.0 |
Name | Version |
---|---|
vsphere | >= 2.1.0 |
No modules.
Name | Type |
---|---|
vsphere_content_library.content_library | resource |
vsphere_content_library_item.items | resource |
vsphere_content_library.content_library | data source |
vsphere_content_library_item.items | data source |
vsphere_datacenter.datacenter | data source |
vsphere_datastore.datastore | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
authentication_method | Method for authenticating users if creating a publication/subscription relationship between content libraries. | string |
null |
no |
content_library_description | The description of the vSphere content library. | string |
null |
no |
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/8.0/vsphere-vm-administration/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 | The name of the vSphere content library (https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-vm-administration/GUID-254B2CE8-20A8-43F0-90E8-3F6776C2C896.html). | string |
"Content library" |
no |
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 |
false |
no |
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 |
false |
no |
datacenter_name | The name of the vSphere datacenter object where the content library will be created (https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-vcenter-esxi-management/GUID-7FDFBDBE-F8AC-4D00-AE5E-3F14D7472FAF.html). | string |
"SDDC-Datacenter" |
no |
datastore_name | The name of the vSphere datastore object where the content library items will be stored (https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-storage/GUID-7BED10DD-3EF2-4670-BA7F-0EEB4EC6EB85.html). | string |
"WorkloadDatastore" |
no |
password | Password if creating a publication/subscription relationship between content libraries with authentication. Password length and complexity requirements are determined by the configuration in vCenter. | string |
null |
no |
publication_published | If true, publish the content library if creating a publication/subscription relationship between content libraries. | bool |
null |
no |
subscription_automatic_sync | If true, enable automatic synchronization with the published library if creating a publication/subscription relationship between content libraries. | bool |
null |
no |
subscription_on_demand | If true, download the published content library items only when needed if creating a publication/subscription relationship between content libraries. | bool |
null |
no |
subscription_url | URL of the published content library if creating a publication/subscription relationship between content libraries. | string |
null |
no |
Name | Description |
---|---|
content_library | The vSphere content library. |
items | The list of vSphere content library items. |