1. Packages
  2. Vsphere Provider
  3. API Docs
  4. ContentLibraryItem
vSphere v4.13.1 published on Wednesday, Feb 5, 2025 by Pulumi

vsphere.ContentLibraryItem

Explore with Pulumi AI

The vsphere.ContentLibraryItem resource can be used to create items in a vSphere content library. The file_url 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.

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),
});
Copy
import pulumi
import pulumi_vsphere as vsphere

datacenter = vsphere.get_datacenter(name="dc-01")
content_library = vsphere.get_content_library(name="clb-01")
content_library_item = vsphere.ContentLibraryItem("content_library_item",
    name="ovf-linux-ubuntu-server-lts",
    description="Ubuntu Server LTS OVF Template",
    file_url="https://releases.example.com/ubuntu/ubuntu/ubuntu-live-server-amd64.ovf",
    library_id=content_library.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vsphere.LookupDatacenter(ctx, &vsphere.LookupDatacenterArgs{
			Name: pulumi.StringRef("dc-01"),
		}, nil)
		if err != nil {
			return err
		}
		contentLibrary, err := vsphere.LookupContentLibrary(ctx, &vsphere.LookupContentLibraryArgs{
			Name: "clb-01",
		}, nil)
		if err != nil {
			return err
		}
		_, err = vsphere.NewContentLibraryItem(ctx, "content_library_item", &vsphere.ContentLibraryItemArgs{
			Name:        pulumi.String("ovf-linux-ubuntu-server-lts"),
			Description: pulumi.String("Ubuntu Server LTS OVF Template"),
			FileUrl:     pulumi.String("https://releases.example.com/ubuntu/ubuntu/ubuntu-live-server-amd64.ovf"),
			LibraryId:   pulumi.String(contentLibrary.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using VSphere = Pulumi.VSphere;

return await Deployment.RunAsync(() => 
{
    var datacenter = VSphere.GetDatacenter.Invoke(new()
    {
        Name = "dc-01",
    });

    var contentLibrary = VSphere.GetContentLibrary.Invoke(new()
    {
        Name = "clb-01",
    });

    var contentLibraryItem = new VSphere.ContentLibraryItem("content_library_item", new()
    {
        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.Apply(getContentLibraryResult => getContentLibraryResult.Id),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vsphere.VsphereFunctions;
import com.pulumi.vsphere.inputs.GetDatacenterArgs;
import com.pulumi.vsphere.inputs.GetContentLibraryArgs;
import com.pulumi.vsphere.ContentLibraryItem;
import com.pulumi.vsphere.ContentLibraryItemArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var datacenter = VsphereFunctions.getDatacenter(GetDatacenterArgs.builder()
            .name("dc-01")
            .build());

        final var contentLibrary = VsphereFunctions.getContentLibrary(GetContentLibraryArgs.builder()
            .name("clb-01")
            .build());

        var contentLibraryItem = new ContentLibraryItem("contentLibraryItem", ContentLibraryItemArgs.builder()
            .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.applyValue(getContentLibraryResult -> getContentLibraryResult.id()))
            .build());

    }
}
Copy
resources:
  contentLibraryItem:
    type: vsphere:ContentLibraryItem
    name: content_library_item
    properties:
      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.id}
variables:
  datacenter:
    fn::invoke:
      function: vsphere:getDatacenter
      arguments:
        name: dc-01
  contentLibrary:
    fn::invoke:
      function: vsphere:getContentLibrary
      arguments:
        name: clb-01
Copy

The next example imports an .iso image to a content library.

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),
});
Copy
import pulumi
import pulumi_vsphere as vsphere

datacenter = vsphere.get_datacenter(name="dc-01")
content_library = vsphere.get_content_library(name="clb-01")
content_library_item = vsphere.ContentLibraryItem("content_library_item",
    name="iso-linux-ubuntu-server-lts",
    description="Ubuntu Server LTS .iso",
    type="iso",
    file_url="https://releases.example.com/ubuntu/ubuntu-live-server-amd64.iso",
    library_id=content_library.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vsphere.LookupDatacenter(ctx, &vsphere.LookupDatacenterArgs{
			Name: pulumi.StringRef("dc-01"),
		}, nil)
		if err != nil {
			return err
		}
		contentLibrary, err := vsphere.LookupContentLibrary(ctx, &vsphere.LookupContentLibraryArgs{
			Name: "clb-01",
		}, nil)
		if err != nil {
			return err
		}
		_, err = vsphere.NewContentLibraryItem(ctx, "content_library_item", &vsphere.ContentLibraryItemArgs{
			Name:        pulumi.String("iso-linux-ubuntu-server-lts"),
			Description: pulumi.String("Ubuntu Server LTS .iso"),
			Type:        pulumi.String("iso"),
			FileUrl:     pulumi.String("https://releases.example.com/ubuntu/ubuntu-live-server-amd64.iso"),
			LibraryId:   pulumi.String(contentLibrary.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using VSphere = Pulumi.VSphere;

return await Deployment.RunAsync(() => 
{
    var datacenter = VSphere.GetDatacenter.Invoke(new()
    {
        Name = "dc-01",
    });

    var contentLibrary = VSphere.GetContentLibrary.Invoke(new()
    {
        Name = "clb-01",
    });

    var contentLibraryItem = new VSphere.ContentLibraryItem("content_library_item", new()
    {
        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.Apply(getContentLibraryResult => getContentLibraryResult.Id),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vsphere.VsphereFunctions;
import com.pulumi.vsphere.inputs.GetDatacenterArgs;
import com.pulumi.vsphere.inputs.GetContentLibraryArgs;
import com.pulumi.vsphere.ContentLibraryItem;
import com.pulumi.vsphere.ContentLibraryItemArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var datacenter = VsphereFunctions.getDatacenter(GetDatacenterArgs.builder()
            .name("dc-01")
            .build());

        final var contentLibrary = VsphereFunctions.getContentLibrary(GetContentLibraryArgs.builder()
            .name("clb-01")
            .build());

        var contentLibraryItem = new ContentLibraryItem("contentLibraryItem", ContentLibraryItemArgs.builder()
            .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.applyValue(getContentLibraryResult -> getContentLibraryResult.id()))
            .build());

    }
}
Copy
resources:
  contentLibraryItem:
    type: vsphere:ContentLibraryItem
    name: content_library_item
    properties:
      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.id}
variables:
  datacenter:
    fn::invoke:
      function: vsphere:getDatacenter
      arguments:
        name: dc-01
  contentLibrary:
    fn::invoke:
      function: vsphere:getContentLibrary
      arguments:
        name: clb-01
Copy

The last example imports a virtual machine image to a content library from an existing virtual machine.

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),
});
Copy
import pulumi
import pulumi_vsphere as vsphere

datacenter = vsphere.get_datacenter(name="dc-01")
content_library = vsphere.get_content_library(name="clb-01")
content_library_item = vsphere.ContentLibraryItem("content_library_item",
    name="tpl-linux-ubuntu-server-lts",
    description="Ubuntu Server LTS",
    source_uuid="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    library_id=content_library.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vsphere.LookupDatacenter(ctx, &vsphere.LookupDatacenterArgs{
			Name: pulumi.StringRef("dc-01"),
		}, nil)
		if err != nil {
			return err
		}
		contentLibrary, err := vsphere.LookupContentLibrary(ctx, &vsphere.LookupContentLibraryArgs{
			Name: "clb-01",
		}, nil)
		if err != nil {
			return err
		}
		_, err = vsphere.NewContentLibraryItem(ctx, "content_library_item", &vsphere.ContentLibraryItemArgs{
			Name:        pulumi.String("tpl-linux-ubuntu-server-lts"),
			Description: pulumi.String("Ubuntu Server LTS"),
			SourceUuid:  pulumi.String("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),
			LibraryId:   pulumi.String(contentLibrary.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using VSphere = Pulumi.VSphere;

return await Deployment.RunAsync(() => 
{
    var datacenter = VSphere.GetDatacenter.Invoke(new()
    {
        Name = "dc-01",
    });

    var contentLibrary = VSphere.GetContentLibrary.Invoke(new()
    {
        Name = "clb-01",
    });

    var contentLibraryItem = new VSphere.ContentLibraryItem("content_library_item", new()
    {
        Name = "tpl-linux-ubuntu-server-lts",
        Description = "Ubuntu Server LTS",
        SourceUuid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        LibraryId = contentLibrary.Apply(getContentLibraryResult => getContentLibraryResult.Id),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vsphere.VsphereFunctions;
import com.pulumi.vsphere.inputs.GetDatacenterArgs;
import com.pulumi.vsphere.inputs.GetContentLibraryArgs;
import com.pulumi.vsphere.ContentLibraryItem;
import com.pulumi.vsphere.ContentLibraryItemArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var datacenter = VsphereFunctions.getDatacenter(GetDatacenterArgs.builder()
            .name("dc-01")
            .build());

        final var contentLibrary = VsphereFunctions.getContentLibrary(GetContentLibraryArgs.builder()
            .name("clb-01")
            .build());

        var contentLibraryItem = new ContentLibraryItem("contentLibraryItem", ContentLibraryItemArgs.builder()
            .name("tpl-linux-ubuntu-server-lts")
            .description("Ubuntu Server LTS")
            .sourceUuid("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
            .libraryId(contentLibrary.applyValue(getContentLibraryResult -> getContentLibraryResult.id()))
            .build());

    }
}
Copy
resources:
  contentLibraryItem:
    type: vsphere:ContentLibraryItem
    name: content_library_item
    properties:
      name: tpl-linux-ubuntu-server-lts
      description: Ubuntu Server LTS
      sourceUuid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
      libraryId: ${contentLibrary.id}
variables:
  datacenter:
    fn::invoke:
      function: vsphere:getDatacenter
      arguments:
        name: dc-01
  contentLibrary:
    fn::invoke:
      function: vsphere:getContentLibrary
      arguments:
        name: clb-01
Copy

Create ContentLibraryItem Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ContentLibraryItem(name: string, args: ContentLibraryItemArgs, opts?: CustomResourceOptions);
@overload
def ContentLibraryItem(resource_name: str,
                       args: ContentLibraryItemArgs,
                       opts: Optional[ResourceOptions] = None)

@overload
def ContentLibraryItem(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       library_id: Optional[str] = None,
                       description: Optional[str] = None,
                       file_url: Optional[str] = None,
                       name: Optional[str] = None,
                       source_uuid: Optional[str] = None,
                       type: Optional[str] = None)
func NewContentLibraryItem(ctx *Context, name string, args ContentLibraryItemArgs, opts ...ResourceOption) (*ContentLibraryItem, error)
public ContentLibraryItem(string name, ContentLibraryItemArgs args, CustomResourceOptions? opts = null)
public ContentLibraryItem(String name, ContentLibraryItemArgs args)
public ContentLibraryItem(String name, ContentLibraryItemArgs args, CustomResourceOptions options)
type: vsphere:ContentLibraryItem
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ContentLibraryItemArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ContentLibraryItemArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ContentLibraryItemArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ContentLibraryItemArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ContentLibraryItemArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var contentLibraryItemResource = new VSphere.ContentLibraryItem("contentLibraryItemResource", new()
{
    LibraryId = "string",
    Description = "string",
    FileUrl = "string",
    Name = "string",
    SourceUuid = "string",
    Type = "string",
});
Copy
example, err := vsphere.NewContentLibraryItem(ctx, "contentLibraryItemResource", &vsphere.ContentLibraryItemArgs{
	LibraryId:   pulumi.String("string"),
	Description: pulumi.String("string"),
	FileUrl:     pulumi.String("string"),
	Name:        pulumi.String("string"),
	SourceUuid:  pulumi.String("string"),
	Type:        pulumi.String("string"),
})
Copy
var contentLibraryItemResource = new ContentLibraryItem("contentLibraryItemResource", ContentLibraryItemArgs.builder()
    .libraryId("string")
    .description("string")
    .fileUrl("string")
    .name("string")
    .sourceUuid("string")
    .type("string")
    .build());
Copy
content_library_item_resource = vsphere.ContentLibraryItem("contentLibraryItemResource",
    library_id="string",
    description="string",
    file_url="string",
    name="string",
    source_uuid="string",
    type="string")
Copy
const contentLibraryItemResource = new vsphere.ContentLibraryItem("contentLibraryItemResource", {
    libraryId: "string",
    description: "string",
    fileUrl: "string",
    name: "string",
    sourceUuid: "string",
    type: "string",
});
Copy
type: vsphere:ContentLibraryItem
properties:
    description: string
    fileUrl: string
    libraryId: string
    name: string
    sourceUuid: string
    type: string
Copy

ContentLibraryItem Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ContentLibraryItem resource accepts the following input properties:

LibraryId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the content library in which to create the item.
Description Changes to this property will trigger replacement. string
A description for the content library item.
FileUrl Changes to this property will trigger replacement. string
File to import as the content library item.
Name Changes to this property will trigger replacement. string
The name of the item to be created in the content library.
SourceUuid Changes to this property will trigger replacement. string
Virtual machine UUID to clone to content library.
Type Changes to this property will trigger replacement. string
Type of content library item. One of "ovf", "iso", or "vm-template". Default: ovf.
LibraryId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the content library in which to create the item.
Description Changes to this property will trigger replacement. string
A description for the content library item.
FileUrl Changes to this property will trigger replacement. string
File to import as the content library item.
Name Changes to this property will trigger replacement. string
The name of the item to be created in the content library.
SourceUuid Changes to this property will trigger replacement. string
Virtual machine UUID to clone to content library.
Type Changes to this property will trigger replacement. string
Type of content library item. One of "ovf", "iso", or "vm-template". Default: ovf.
libraryId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the content library in which to create the item.
description Changes to this property will trigger replacement. String
A description for the content library item.
fileUrl Changes to this property will trigger replacement. String
File to import as the content library item.
name Changes to this property will trigger replacement. String
The name of the item to be created in the content library.
sourceUuid Changes to this property will trigger replacement. String
Virtual machine UUID to clone to content library.
type Changes to this property will trigger replacement. String
Type of content library item. One of "ovf", "iso", or "vm-template". Default: ovf.
libraryId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the content library in which to create the item.
description Changes to this property will trigger replacement. string
A description for the content library item.
fileUrl Changes to this property will trigger replacement. string
File to import as the content library item.
name Changes to this property will trigger replacement. string
The name of the item to be created in the content library.
sourceUuid Changes to this property will trigger replacement. string
Virtual machine UUID to clone to content library.
type Changes to this property will trigger replacement. string
Type of content library item. One of "ovf", "iso", or "vm-template". Default: ovf.
library_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the content library in which to create the item.
description Changes to this property will trigger replacement. str
A description for the content library item.
file_url Changes to this property will trigger replacement. str
File to import as the content library item.
name Changes to this property will trigger replacement. str
The name of the item to be created in the content library.
source_uuid Changes to this property will trigger replacement. str
Virtual machine UUID to clone to content library.
type Changes to this property will trigger replacement. str
Type of content library item. One of "ovf", "iso", or "vm-template". Default: ovf.
libraryId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the content library in which to create the item.
description Changes to this property will trigger replacement. String
A description for the content library item.
fileUrl Changes to this property will trigger replacement. String
File to import as the content library item.
name Changes to this property will trigger replacement. String
The name of the item to be created in the content library.
sourceUuid Changes to this property will trigger replacement. String
Virtual machine UUID to clone to content library.
type Changes to this property will trigger replacement. String
Type of content library item. One of "ovf", "iso", or "vm-template". Default: ovf.

Outputs

All input properties are implicitly available as output properties. Additionally, the ContentLibraryItem resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ContentLibraryItem Resource

Get an existing ContentLibraryItem resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ContentLibraryItemState, opts?: CustomResourceOptions): ContentLibraryItem
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        file_url: Optional[str] = None,
        library_id: Optional[str] = None,
        name: Optional[str] = None,
        source_uuid: Optional[str] = None,
        type: Optional[str] = None) -> ContentLibraryItem
func GetContentLibraryItem(ctx *Context, name string, id IDInput, state *ContentLibraryItemState, opts ...ResourceOption) (*ContentLibraryItem, error)
public static ContentLibraryItem Get(string name, Input<string> id, ContentLibraryItemState? state, CustomResourceOptions? opts = null)
public static ContentLibraryItem get(String name, Output<String> id, ContentLibraryItemState state, CustomResourceOptions options)
resources:  _:    type: vsphere:ContentLibraryItem    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Description Changes to this property will trigger replacement. string
A description for the content library item.
FileUrl Changes to this property will trigger replacement. string
File to import as the content library item.
LibraryId Changes to this property will trigger replacement. string
The ID of the content library in which to create the item.
Name Changes to this property will trigger replacement. string
The name of the item to be created in the content library.
SourceUuid Changes to this property will trigger replacement. string
Virtual machine UUID to clone to content library.
Type Changes to this property will trigger replacement. string
Type of content library item. One of "ovf", "iso", or "vm-template". Default: ovf.
Description Changes to this property will trigger replacement. string
A description for the content library item.
FileUrl Changes to this property will trigger replacement. string
File to import as the content library item.
LibraryId Changes to this property will trigger replacement. string
The ID of the content library in which to create the item.
Name Changes to this property will trigger replacement. string
The name of the item to be created in the content library.
SourceUuid Changes to this property will trigger replacement. string
Virtual machine UUID to clone to content library.
Type Changes to this property will trigger replacement. string
Type of content library item. One of "ovf", "iso", or "vm-template". Default: ovf.
description Changes to this property will trigger replacement. String
A description for the content library item.
fileUrl Changes to this property will trigger replacement. String
File to import as the content library item.
libraryId Changes to this property will trigger replacement. String
The ID of the content library in which to create the item.
name Changes to this property will trigger replacement. String
The name of the item to be created in the content library.
sourceUuid Changes to this property will trigger replacement. String
Virtual machine UUID to clone to content library.
type Changes to this property will trigger replacement. String
Type of content library item. One of "ovf", "iso", or "vm-template". Default: ovf.
description Changes to this property will trigger replacement. string
A description for the content library item.
fileUrl Changes to this property will trigger replacement. string
File to import as the content library item.
libraryId Changes to this property will trigger replacement. string
The ID of the content library in which to create the item.
name Changes to this property will trigger replacement. string
The name of the item to be created in the content library.
sourceUuid Changes to this property will trigger replacement. string
Virtual machine UUID to clone to content library.
type Changes to this property will trigger replacement. string
Type of content library item. One of "ovf", "iso", or "vm-template". Default: ovf.
description Changes to this property will trigger replacement. str
A description for the content library item.
file_url Changes to this property will trigger replacement. str
File to import as the content library item.
library_id Changes to this property will trigger replacement. str
The ID of the content library in which to create the item.
name Changes to this property will trigger replacement. str
The name of the item to be created in the content library.
source_uuid Changes to this property will trigger replacement. str
Virtual machine UUID to clone to content library.
type Changes to this property will trigger replacement. str
Type of content library item. One of "ovf", "iso", or "vm-template". Default: ovf.
description Changes to this property will trigger replacement. String
A description for the content library item.
fileUrl Changes to this property will trigger replacement. String
File to import as the content library item.
libraryId Changes to this property will trigger replacement. String
The ID of the content library in which to create the item.
name Changes to this property will trigger replacement. String
The name of the item to be created in the content library.
sourceUuid Changes to this property will trigger replacement. String
Virtual machine UUID to clone to content library.
type Changes to this property will trigger replacement. String
Type of content library item. One of "ovf", "iso", or "vm-template". Default: ovf.

Import

An existing content library item can be imported into this resource by

supplying the content library ID. An example is below:

$ pulumi import vsphere:index/contentLibraryItem:ContentLibraryItem vsphere_content_library_item iso-linux-ubuntu-server-lts xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
vSphere pulumi/pulumi-vsphere
License
Apache-2.0
Notes
This Pulumi package is based on the vsphere Terraform Provider.