1. Packages
  2. Vra Provider
  3. API Docs
  4. CatalogItemVmImage
vra 0.13.0 published on Wednesday, May 14, 2025 by vmware

vra.CatalogItemVmImage

Explore with Pulumi AI

vra logo
vra 0.13.0 published on Wednesday, May 14, 2025 by vmware

    Creates a Catalog Item resource from a VM Image.

    Example Usage

    S

    The following example shows how to create a catalog item resource from a VM image:

    import * as pulumi from "@pulumi/pulumi";
    import * as vra from "@pulumi/vra";
    
    const catalogItemVmImage = new vra.CatalogItemVmImage("catalogItemVmImage", {
        description: "Catalog Item [terraform-vm-image] created by Terraform",
        projectId: _var.project_id,
        imageName: _var.image_name,
        cloudConfig: `#cloud-config
    # Sample cloud-config creating an admin user. Items in {{}} will appear as user inputs when deploying the VM.
    users:
      - name: {{user_name}}
        plain_text_passwd: {{password}}
        lock_passwd: false
        sudo:
          - ALL=(ALL) NOPASSWD:ALL
        groups: sudo`,
    });
    
    import pulumi
    import pulumi_vra as vra
    
    catalog_item_vm_image = vra.CatalogItemVmImage("catalogItemVmImage",
        description="Catalog Item [terraform-vm-image] created by Terraform",
        project_id=var["project_id"],
        image_name=var["image_name"],
        cloud_config="""#cloud-config
    # Sample cloud-config creating an admin user. Items in {{}} will appear as user inputs when deploying the VM.
    users:
      - name: {{user_name}}
        plain_text_passwd: {{password}}
        lock_passwd: false
        sudo:
          - ALL=(ALL) NOPASSWD:ALL
        groups: sudo""")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vra.NewCatalogItemVmImage(ctx, "catalogItemVmImage", &vra.CatalogItemVmImageArgs{
    			Description: pulumi.String("Catalog Item [terraform-vm-image] created by Terraform"),
    			ProjectId:   pulumi.Any(_var.Project_id),
    			ImageName:   pulumi.Any(_var.Image_name),
    			CloudConfig: pulumi.String(`#cloud-config
    # Sample cloud-config creating an admin user. Items in {{}} will appear as user inputs when deploying the VM.
    users:
      - name: {{user_name}}
        plain_text_passwd: {{password}}
        lock_passwd: false
        sudo:
          - ALL=(ALL) NOPASSWD:ALL
        groups: sudo`),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vra = Pulumi.Vra;
    
    return await Deployment.RunAsync(() => 
    {
        var catalogItemVmImage = new Vra.CatalogItemVmImage("catalogItemVmImage", new()
        {
            Description = "Catalog Item [terraform-vm-image] created by Terraform",
            ProjectId = @var.Project_id,
            ImageName = @var.Image_name,
            CloudConfig = @"#cloud-config
    # Sample cloud-config creating an admin user. Items in {{}} will appear as user inputs when deploying the VM.
    users:
      - name: {{user_name}}
        plain_text_passwd: {{password}}
        lock_passwd: false
        sudo:
          - ALL=(ALL) NOPASSWD:ALL
        groups: sudo",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vra.CatalogItemVmImage;
    import com.pulumi.vra.CatalogItemVmImageArgs;
    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) {
            var catalogItemVmImage = new CatalogItemVmImage("catalogItemVmImage", CatalogItemVmImageArgs.builder()
                .description("Catalog Item [terraform-vm-image] created by Terraform")
                .projectId(var_.project_id())
                .imageName(var_.image_name())
                .cloudConfig("""
    #cloud-config
    # Sample cloud-config creating an admin user. Items in {{}} will appear as user inputs when deploying the VM.
    users:
      - name: {{user_name}}
        plain_text_passwd: {{password}}
        lock_passwd: false
        sudo:
          - ALL=(ALL) NOPASSWD:ALL
        groups: sudo            """)
                .build());
    
        }
    }
    
    resources:
      catalogItemVmImage:
        type: vra:CatalogItemVmImage
        properties:
          description: Catalog Item [terraform-vm-image] created by Terraform
          projectId: ${var.project_id}
          imageName: ${var.image_name}
          cloudConfig: |-
            #cloud-config
            # Sample cloud-config creating an admin user. Items in {{}} will appear as user inputs when deploying the VM.
            users:
              - name: {{user_name}}
                plain_text_passwd: {{password}}
                lock_passwd: false
                sudo:
                  - ALL=(ALL) NOPASSWD:ALL
                groups: sudo        
    

    Create CatalogItemVmImage Resource

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

    Constructor syntax

    new CatalogItemVmImage(name: string, args: CatalogItemVmImageArgs, opts?: CustomResourceOptions);
    @overload
    def CatalogItemVmImage(resource_name: str,
                           args: CatalogItemVmImageArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def CatalogItemVmImage(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           image_name: Optional[str] = None,
                           project_id: Optional[str] = None,
                           catalog_item_vm_image_id: Optional[str] = None,
                           cloud_config: Optional[str] = None,
                           description: Optional[str] = None,
                           global_: Optional[bool] = None,
                           icon_id: Optional[str] = None,
                           name: Optional[str] = None,
                           select_zone: Optional[bool] = None)
    func NewCatalogItemVmImage(ctx *Context, name string, args CatalogItemVmImageArgs, opts ...ResourceOption) (*CatalogItemVmImage, error)
    public CatalogItemVmImage(string name, CatalogItemVmImageArgs args, CustomResourceOptions? opts = null)
    public CatalogItemVmImage(String name, CatalogItemVmImageArgs args)
    public CatalogItemVmImage(String name, CatalogItemVmImageArgs args, CustomResourceOptions options)
    
    type: vra:CatalogItemVmImage
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CatalogItemVmImageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CatalogItemVmImageArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CatalogItemVmImageArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CatalogItemVmImageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CatalogItemVmImageArgs
    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 catalogItemVmImageResource = new Vra.CatalogItemVmImage("catalogItemVmImageResource", new()
    {
        ImageName = "string",
        ProjectId = "string",
        CatalogItemVmImageId = "string",
        CloudConfig = "string",
        Description = "string",
        Global = false,
        IconId = "string",
        Name = "string",
        SelectZone = false,
    });
    
    example, err := vra.NewCatalogItemVmImage(ctx, "catalogItemVmImageResource", &vra.CatalogItemVmImageArgs{
    	ImageName:            pulumi.String("string"),
    	ProjectId:            pulumi.String("string"),
    	CatalogItemVmImageId: pulumi.String("string"),
    	CloudConfig:          pulumi.String("string"),
    	Description:          pulumi.String("string"),
    	Global:               pulumi.Bool(false),
    	IconId:               pulumi.String("string"),
    	Name:                 pulumi.String("string"),
    	SelectZone:           pulumi.Bool(false),
    })
    
    var catalogItemVmImageResource = new CatalogItemVmImage("catalogItemVmImageResource", CatalogItemVmImageArgs.builder()
        .imageName("string")
        .projectId("string")
        .catalogItemVmImageId("string")
        .cloudConfig("string")
        .description("string")
        .global(false)
        .iconId("string")
        .name("string")
        .selectZone(false)
        .build());
    
    catalog_item_vm_image_resource = vra.CatalogItemVmImage("catalogItemVmImageResource",
        image_name="string",
        project_id="string",
        catalog_item_vm_image_id="string",
        cloud_config="string",
        description="string",
        global_=False,
        icon_id="string",
        name="string",
        select_zone=False)
    
    const catalogItemVmImageResource = new vra.CatalogItemVmImage("catalogItemVmImageResource", {
        imageName: "string",
        projectId: "string",
        catalogItemVmImageId: "string",
        cloudConfig: "string",
        description: "string",
        global: false,
        iconId: "string",
        name: "string",
        selectZone: false,
    });
    
    type: vra:CatalogItemVmImage
    properties:
        catalogItemVmImageId: string
        cloudConfig: string
        description: string
        global: false
        iconId: string
        imageName: string
        name: string
        projectId: string
        selectZone: false
    

    CatalogItemVmImage 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 CatalogItemVmImage resource accepts the following input properties:

    ImageName string
    Name of the VM image to publish.
    ProjectId string
    ID of the project to share this catalog item with.
    CatalogItemVmImageId string
    CloudConfig string
    Cloud config script to be applied to VMs provisioned from this image.
    Description string
    A human-friendly description for the catalog item.
    Global bool
    Whether to allow this catalog to be shared with multiple projects or to restrict it to the specified project.
    IconId string
    ID of the icon to associate with this catalog item.
    Name string
    The name of the catalog item.
    SelectZone bool
    Whether to create a zone input for the published catalog item.
    ImageName string
    Name of the VM image to publish.
    ProjectId string
    ID of the project to share this catalog item with.
    CatalogItemVmImageId string
    CloudConfig string
    Cloud config script to be applied to VMs provisioned from this image.
    Description string
    A human-friendly description for the catalog item.
    Global bool
    Whether to allow this catalog to be shared with multiple projects or to restrict it to the specified project.
    IconId string
    ID of the icon to associate with this catalog item.
    Name string
    The name of the catalog item.
    SelectZone bool
    Whether to create a zone input for the published catalog item.
    imageName String
    Name of the VM image to publish.
    projectId String
    ID of the project to share this catalog item with.
    catalogItemVmImageId String
    cloudConfig String
    Cloud config script to be applied to VMs provisioned from this image.
    description String
    A human-friendly description for the catalog item.
    global Boolean
    Whether to allow this catalog to be shared with multiple projects or to restrict it to the specified project.
    iconId String
    ID of the icon to associate with this catalog item.
    name String
    The name of the catalog item.
    selectZone Boolean
    Whether to create a zone input for the published catalog item.
    imageName string
    Name of the VM image to publish.
    projectId string
    ID of the project to share this catalog item with.
    catalogItemVmImageId string
    cloudConfig string
    Cloud config script to be applied to VMs provisioned from this image.
    description string
    A human-friendly description for the catalog item.
    global boolean
    Whether to allow this catalog to be shared with multiple projects or to restrict it to the specified project.
    iconId string
    ID of the icon to associate with this catalog item.
    name string
    The name of the catalog item.
    selectZone boolean
    Whether to create a zone input for the published catalog item.
    image_name str
    Name of the VM image to publish.
    project_id str
    ID of the project to share this catalog item with.
    catalog_item_vm_image_id str
    cloud_config str
    Cloud config script to be applied to VMs provisioned from this image.
    description str
    A human-friendly description for the catalog item.
    global_ bool
    Whether to allow this catalog to be shared with multiple projects or to restrict it to the specified project.
    icon_id str
    ID of the icon to associate with this catalog item.
    name str
    The name of the catalog item.
    select_zone bool
    Whether to create a zone input for the published catalog item.
    imageName String
    Name of the VM image to publish.
    projectId String
    ID of the project to share this catalog item with.
    catalogItemVmImageId String
    cloudConfig String
    Cloud config script to be applied to VMs provisioned from this image.
    description String
    A human-friendly description for the catalog item.
    global Boolean
    Whether to allow this catalog to be shared with multiple projects or to restrict it to the specified project.
    iconId String
    ID of the icon to associate with this catalog item.
    name String
    The name of the catalog item.
    selectZone Boolean
    Whether to create a zone input for the published catalog item.

    Outputs

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

    CreatedAt string
    Date when the entity was created. The date is in ISO 8601 and UTC.
    CreatedBy string
    The user the entity was created by.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    LastUpdatedBy string
    The user the entity was last updated by.
    CreatedAt string
    Date when the entity was created. The date is in ISO 8601 and UTC.
    CreatedBy string
    The user the entity was created by.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    LastUpdatedBy string
    The user the entity was last updated by.
    createdAt String
    Date when the entity was created. The date is in ISO 8601 and UTC.
    createdBy String
    The user the entity was created by.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    lastUpdatedBy String
    The user the entity was last updated by.
    createdAt string
    Date when the entity was created. The date is in ISO 8601 and UTC.
    createdBy string
    The user the entity was created by.
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    lastUpdatedBy string
    The user the entity was last updated by.
    created_at str
    Date when the entity was created. The date is in ISO 8601 and UTC.
    created_by str
    The user the entity was created by.
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated_at str
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    last_updated_by str
    The user the entity was last updated by.
    createdAt String
    Date when the entity was created. The date is in ISO 8601 and UTC.
    createdBy String
    The user the entity was created by.
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    lastUpdatedBy String
    The user the entity was last updated by.

    Look up Existing CatalogItemVmImage Resource

    Get an existing CatalogItemVmImage 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?: CatalogItemVmImageState, opts?: CustomResourceOptions): CatalogItemVmImage
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            catalog_item_vm_image_id: Optional[str] = None,
            cloud_config: Optional[str] = None,
            created_at: Optional[str] = None,
            created_by: Optional[str] = None,
            description: Optional[str] = None,
            global_: Optional[bool] = None,
            icon_id: Optional[str] = None,
            image_name: Optional[str] = None,
            last_updated_at: Optional[str] = None,
            last_updated_by: Optional[str] = None,
            name: Optional[str] = None,
            project_id: Optional[str] = None,
            select_zone: Optional[bool] = None) -> CatalogItemVmImage
    func GetCatalogItemVmImage(ctx *Context, name string, id IDInput, state *CatalogItemVmImageState, opts ...ResourceOption) (*CatalogItemVmImage, error)
    public static CatalogItemVmImage Get(string name, Input<string> id, CatalogItemVmImageState? state, CustomResourceOptions? opts = null)
    public static CatalogItemVmImage get(String name, Output<String> id, CatalogItemVmImageState state, CustomResourceOptions options)
    resources:  _:    type: vra:CatalogItemVmImage    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    CatalogItemVmImageId string
    CloudConfig string
    Cloud config script to be applied to VMs provisioned from this image.
    CreatedAt string
    Date when the entity was created. The date is in ISO 8601 and UTC.
    CreatedBy string
    The user the entity was created by.
    Description string
    A human-friendly description for the catalog item.
    Global bool
    Whether to allow this catalog to be shared with multiple projects or to restrict it to the specified project.
    IconId string
    ID of the icon to associate with this catalog item.
    ImageName string
    Name of the VM image to publish.
    LastUpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    LastUpdatedBy string
    The user the entity was last updated by.
    Name string
    The name of the catalog item.
    ProjectId string
    ID of the project to share this catalog item with.
    SelectZone bool
    Whether to create a zone input for the published catalog item.
    CatalogItemVmImageId string
    CloudConfig string
    Cloud config script to be applied to VMs provisioned from this image.
    CreatedAt string
    Date when the entity was created. The date is in ISO 8601 and UTC.
    CreatedBy string
    The user the entity was created by.
    Description string
    A human-friendly description for the catalog item.
    Global bool
    Whether to allow this catalog to be shared with multiple projects or to restrict it to the specified project.
    IconId string
    ID of the icon to associate with this catalog item.
    ImageName string
    Name of the VM image to publish.
    LastUpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    LastUpdatedBy string
    The user the entity was last updated by.
    Name string
    The name of the catalog item.
    ProjectId string
    ID of the project to share this catalog item with.
    SelectZone bool
    Whether to create a zone input for the published catalog item.
    catalogItemVmImageId String
    cloudConfig String
    Cloud config script to be applied to VMs provisioned from this image.
    createdAt String
    Date when the entity was created. The date is in ISO 8601 and UTC.
    createdBy String
    The user the entity was created by.
    description String
    A human-friendly description for the catalog item.
    global Boolean
    Whether to allow this catalog to be shared with multiple projects or to restrict it to the specified project.
    iconId String
    ID of the icon to associate with this catalog item.
    imageName String
    Name of the VM image to publish.
    lastUpdatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    lastUpdatedBy String
    The user the entity was last updated by.
    name String
    The name of the catalog item.
    projectId String
    ID of the project to share this catalog item with.
    selectZone Boolean
    Whether to create a zone input for the published catalog item.
    catalogItemVmImageId string
    cloudConfig string
    Cloud config script to be applied to VMs provisioned from this image.
    createdAt string
    Date when the entity was created. The date is in ISO 8601 and UTC.
    createdBy string
    The user the entity was created by.
    description string
    A human-friendly description for the catalog item.
    global boolean
    Whether to allow this catalog to be shared with multiple projects or to restrict it to the specified project.
    iconId string
    ID of the icon to associate with this catalog item.
    imageName string
    Name of the VM image to publish.
    lastUpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    lastUpdatedBy string
    The user the entity was last updated by.
    name string
    The name of the catalog item.
    projectId string
    ID of the project to share this catalog item with.
    selectZone boolean
    Whether to create a zone input for the published catalog item.
    catalog_item_vm_image_id str
    cloud_config str
    Cloud config script to be applied to VMs provisioned from this image.
    created_at str
    Date when the entity was created. The date is in ISO 8601 and UTC.
    created_by str
    The user the entity was created by.
    description str
    A human-friendly description for the catalog item.
    global_ bool
    Whether to allow this catalog to be shared with multiple projects or to restrict it to the specified project.
    icon_id str
    ID of the icon to associate with this catalog item.
    image_name str
    Name of the VM image to publish.
    last_updated_at str
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    last_updated_by str
    The user the entity was last updated by.
    name str
    The name of the catalog item.
    project_id str
    ID of the project to share this catalog item with.
    select_zone bool
    Whether to create a zone input for the published catalog item.
    catalogItemVmImageId String
    cloudConfig String
    Cloud config script to be applied to VMs provisioned from this image.
    createdAt String
    Date when the entity was created. The date is in ISO 8601 and UTC.
    createdBy String
    The user the entity was created by.
    description String
    A human-friendly description for the catalog item.
    global Boolean
    Whether to allow this catalog to be shared with multiple projects or to restrict it to the specified project.
    iconId String
    ID of the icon to associate with this catalog item.
    imageName String
    Name of the VM image to publish.
    lastUpdatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    lastUpdatedBy String
    The user the entity was last updated by.
    name String
    The name of the catalog item.
    projectId String
    ID of the project to share this catalog item with.
    selectZone Boolean
    Whether to create a zone input for the published catalog item.

    Import

    To import an existing Catalog Item, use the id as in the following example:

    $ pulumi import vra:index/catalogItemVmImage:CatalogItemVmImage catalog_item_vm_image "b580ef9f-f191-4de2-b6f4-96f29d8c8d3d"`
    

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

    Package Details

    Repository
    vra vmware/terraform-provider-vra
    License
    Notes
    This Pulumi package is based on the vra Terraform Provider.
    vra logo
    vra 0.13.0 published on Wednesday, May 14, 2025 by vmware