@pulumi/vsphere
Version:
A Pulumi package for creating vsphere resources
199 lines (198 loc) • 6.91 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* The `vsphere.ContentLibraryItem` resource can be used to create items in a
* vSphere content library. The `fileUrl` must be accessible from the vSphere
* environment as it will be downloaded from the specified location and stored
* on the content library's storage backing.
*
* ## Example Usage
*
* The first example below imports an OVF Template to a content
* library.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vsphere from "@pulumi/vsphere";
*
* const datacenter = vsphere.getDatacenter({
* name: "dc-01",
* });
* const contentLibrary = vsphere.getContentLibrary({
* name: "clb-01",
* });
* const contentLibraryItem = new vsphere.ContentLibraryItem("content_library_item", {
* name: "ovf-linux-ubuntu-server-lts",
* description: "Ubuntu Server LTS OVF Template",
* fileUrl: "https://releases.example.com/ubuntu/ubuntu/ubuntu-live-server-amd64.ovf",
* libraryId: contentLibrary.then(contentLibrary => contentLibrary.id),
* });
* ```
*
* The next example imports an .iso image to a content library.
*
* [tf-vsphere-vm-resource]: /docs/providers/vsphere/r/virtual_machine.html
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vsphere from "@pulumi/vsphere";
*
* const datacenter = vsphere.getDatacenter({
* name: "dc-01",
* });
* const contentLibrary = vsphere.getContentLibrary({
* name: "clb-01",
* });
* const contentLibraryItem = new vsphere.ContentLibraryItem("content_library_item", {
* name: "iso-linux-ubuntu-server-lts",
* description: "Ubuntu Server LTS .iso",
* type: "iso",
* fileUrl: "https://releases.example.com/ubuntu/ubuntu-live-server-amd64.iso",
* libraryId: contentLibrary.then(contentLibrary => contentLibrary.id),
* });
* ```
*
* The last example imports a virtual machine image to a content library from an
* existing virtual machine.
*
* [tf-vsphere-vm-resource]: /docs/providers/vsphere/r/virtual_machine.html
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vsphere from "@pulumi/vsphere";
*
* const datacenter = vsphere.getDatacenter({
* name: "dc-01",
* });
* const contentLibrary = vsphere.getContentLibrary({
* name: "clb-01",
* });
* const contentLibraryItem = new vsphere.ContentLibraryItem("content_library_item", {
* name: "tpl-linux-ubuntu-server-lts",
* description: "Ubuntu Server LTS",
* sourceUuid: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
* libraryId: contentLibrary.then(contentLibrary => contentLibrary.id),
* });
* ```
*
* ## Import
*
* An existing content library item can be imported into this resource by
*
* supplying the content library ID. An example is below:
*
* [docs-import]: https://developer.hashicorp.com/terraform/cli/import
*
* ```sh
* $ pulumi import vsphere:index/contentLibraryItem:ContentLibraryItem vsphere_content_library_item iso-linux-ubuntu-server-lts xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
* ```
*/
export declare class ContentLibraryItem extends pulumi.CustomResource {
/**
* Get an existing ContentLibraryItem resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ContentLibraryItemState, opts?: pulumi.CustomResourceOptions): ContentLibraryItem;
/**
* Returns true if the given object is an instance of ContentLibraryItem. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is ContentLibraryItem;
/**
* A description for the content library item.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* File to import as the content library item.
*/
readonly fileUrl: pulumi.Output<string | undefined>;
/**
* The ID of the content library in which to create the item.
*/
readonly libraryId: pulumi.Output<string>;
/**
* The name of the item to be created in the content library.
*/
readonly name: pulumi.Output<string>;
/**
* Virtual machine UUID to clone to content library.
*/
readonly sourceUuid: pulumi.Output<string | undefined>;
/**
* Type of content library item.
* One of "ovf", "iso", or "vm-template". Default: `ovf`.
*/
readonly type: pulumi.Output<string | undefined>;
/**
* Create a ContentLibraryItem resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ContentLibraryItemArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering ContentLibraryItem resources.
*/
export interface ContentLibraryItemState {
/**
* A description for the content library item.
*/
description?: pulumi.Input<string>;
/**
* File to import as the content library item.
*/
fileUrl?: pulumi.Input<string>;
/**
* The ID of the content library in which to create the item.
*/
libraryId?: pulumi.Input<string>;
/**
* The name of the item to be created in the content library.
*/
name?: pulumi.Input<string>;
/**
* Virtual machine UUID to clone to content library.
*/
sourceUuid?: pulumi.Input<string>;
/**
* Type of content library item.
* One of "ovf", "iso", or "vm-template". Default: `ovf`.
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a ContentLibraryItem resource.
*/
export interface ContentLibraryItemArgs {
/**
* A description for the content library item.
*/
description?: pulumi.Input<string>;
/**
* File to import as the content library item.
*/
fileUrl?: pulumi.Input<string>;
/**
* The ID of the content library in which to create the item.
*/
libraryId: pulumi.Input<string>;
/**
* The name of the item to be created in the content library.
*/
name?: pulumi.Input<string>;
/**
* Virtual machine UUID to clone to content library.
*/
sourceUuid?: pulumi.Input<string>;
/**
* Type of content library item.
* One of "ovf", "iso", or "vm-template". Default: `ovf`.
*/
type?: pulumi.Input<string>;
}