vra.CatalogItemVmImage
Explore with Pulumi AI
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:
- Image
Name string - Name of the VM image to publish.
- Project
Id string - ID of the project to share this catalog item with.
- Catalog
Item stringVm Image Id - Cloud
Config 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.
- Icon
Id string - ID of the icon to associate with this catalog item.
- Name string
- The name of the catalog item.
- Select
Zone bool - Whether to create a zone input for the published catalog item.
- Image
Name string - Name of the VM image to publish.
- Project
Id string - ID of the project to share this catalog item with.
- Catalog
Item stringVm Image Id - Cloud
Config 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.
- Icon
Id string - ID of the icon to associate with this catalog item.
- Name string
- The name of the catalog item.
- Select
Zone bool - Whether to create a zone input for the published catalog item.
- image
Name String - Name of the VM image to publish.
- project
Id String - ID of the project to share this catalog item with.
- catalog
Item StringVm Image Id - cloud
Config 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.
- icon
Id String - ID of the icon to associate with this catalog item.
- name String
- The name of the catalog item.
- select
Zone Boolean - Whether to create a zone input for the published catalog item.
- image
Name string - Name of the VM image to publish.
- project
Id string - ID of the project to share this catalog item with.
- catalog
Item stringVm Image Id - cloud
Config 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.
- icon
Id string - ID of the icon to associate with this catalog item.
- name string
- The name of the catalog item.
- select
Zone 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_ strvm_ image_ id - 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.
- image
Name String - Name of the VM image to publish.
- project
Id String - ID of the project to share this catalog item with.
- catalog
Item StringVm Image Id - cloud
Config 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.
- icon
Id String - ID of the icon to associate with this catalog item.
- name String
- The name of the catalog item.
- select
Zone 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:
- Created
At string - Date when the entity was created. The date is in ISO 8601 and UTC.
- Created
By string - The user the entity was created by.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated stringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- Last
Updated stringBy - The user the entity was last updated by.
- Created
At string - Date when the entity was created. The date is in ISO 8601 and UTC.
- Created
By string - The user the entity was created by.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated stringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- Last
Updated stringBy - The user the entity was last updated by.
- created
At String - Date when the entity was created. The date is in ISO 8601 and UTC.
- created
By String - The user the entity was created by.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated StringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- last
Updated StringBy - The user the entity was last updated by.
- created
At string - Date when the entity was created. The date is in ISO 8601 and UTC.
- created
By string - The user the entity was created by.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Updated stringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- last
Updated stringBy - 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_ strat - Date when the entity was last updated. The date is ISO 8601 and UTC.
- last_
updated_ strby - The user the entity was last updated by.
- created
At String - Date when the entity was created. The date is in ISO 8601 and UTC.
- created
By String - The user the entity was created by.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated StringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- last
Updated StringBy - 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.
- Catalog
Item stringVm Image Id - Cloud
Config string - Cloud config script to be applied to VMs provisioned from this image.
- Created
At string - Date when the entity was created. The date is in ISO 8601 and UTC.
- Created
By 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.
- Icon
Id string - ID of the icon to associate with this catalog item.
- Image
Name string - Name of the VM image to publish.
- Last
Updated stringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- Last
Updated stringBy - The user the entity was last updated by.
- Name string
- The name of the catalog item.
- Project
Id string - ID of the project to share this catalog item with.
- Select
Zone bool - Whether to create a zone input for the published catalog item.
- Catalog
Item stringVm Image Id - Cloud
Config string - Cloud config script to be applied to VMs provisioned from this image.
- Created
At string - Date when the entity was created. The date is in ISO 8601 and UTC.
- Created
By 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.
- Icon
Id string - ID of the icon to associate with this catalog item.
- Image
Name string - Name of the VM image to publish.
- Last
Updated stringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- Last
Updated stringBy - The user the entity was last updated by.
- Name string
- The name of the catalog item.
- Project
Id string - ID of the project to share this catalog item with.
- Select
Zone bool - Whether to create a zone input for the published catalog item.
- catalog
Item StringVm Image Id - cloud
Config String - Cloud config script to be applied to VMs provisioned from this image.
- created
At String - Date when the entity was created. The date is in ISO 8601 and UTC.
- created
By 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.
- icon
Id String - ID of the icon to associate with this catalog item.
- image
Name String - Name of the VM image to publish.
- last
Updated StringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- last
Updated StringBy - The user the entity was last updated by.
- name String
- The name of the catalog item.
- project
Id String - ID of the project to share this catalog item with.
- select
Zone Boolean - Whether to create a zone input for the published catalog item.
- catalog
Item stringVm Image Id - cloud
Config string - Cloud config script to be applied to VMs provisioned from this image.
- created
At string - Date when the entity was created. The date is in ISO 8601 and UTC.
- created
By 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.
- icon
Id string - ID of the icon to associate with this catalog item.
- image
Name string - Name of the VM image to publish.
- last
Updated stringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- last
Updated stringBy - The user the entity was last updated by.
- name string
- The name of the catalog item.
- project
Id string - ID of the project to share this catalog item with.
- select
Zone boolean - Whether to create a zone input for the published catalog item.
- catalog_
item_ strvm_ image_ id - 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_ strat - Date when the entity was last updated. The date is ISO 8601 and UTC.
- last_
updated_ strby - 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.
- catalog
Item StringVm Image Id - cloud
Config String - Cloud config script to be applied to VMs provisioned from this image.
- created
At String - Date when the entity was created. The date is in ISO 8601 and UTC.
- created
By 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.
- icon
Id String - ID of the icon to associate with this catalog item.
- image
Name String - Name of the VM image to publish.
- last
Updated StringAt - Date when the entity was last updated. The date is ISO 8601 and UTC.
- last
Updated StringBy - The user the entity was last updated by.
- name String
- The name of the catalog item.
- project
Id String - ID of the project to share this catalog item with.
- select
Zone 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.