@pulumi/vsphere
Version:
A Pulumi package for creating vsphere resources
277 lines (276 loc) • 10.1 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* The `vsphere.VappEntity` resource can be used to describe the behavior of an
* entity (virtual machine or sub-vApp container) in a vApp container.
*
* For more information on vSphere vApps, see [this
* page][ref-vsphere-vapp].
*
* [ref-vsphere-vapp]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/create-a-vapp-h5-and-flex.html
*
* ## Example Usage
*
* The basic example below sets up a vApp container and a virtual machine in a
* compute cluster and then creates a vApp entity to change the virtual machine's
* power on behavior in the vApp container.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vsphere from "@pulumi/vsphere";
*
* const config = new pulumi.Config();
* const datacenter = config.get("datacenter") || "dc-01";
* const cluster = config.get("cluster") || "cluster-01";
* const datacenterGetDatacenter = vsphere.getDatacenter({
* name: datacenter,
* });
* const computeCluster = datacenterGetDatacenter.then(datacenterGetDatacenter => vsphere.getComputeCluster({
* name: cluster,
* datacenterId: datacenterGetDatacenter.id,
* }));
* const network = datacenterGetDatacenter.then(datacenterGetDatacenter => vsphere.getNetwork({
* name: "network1",
* datacenterId: datacenterGetDatacenter.id,
* }));
* const datastore = datacenterGetDatacenter.then(datacenterGetDatacenter => vsphere.getDatastore({
* name: "datastore1",
* datacenterId: datacenterGetDatacenter.id,
* }));
* const vappContainer = new vsphere.VappContainer("vapp_container", {
* name: "vapp-container-test",
* parentResourcePoolId: computeCluster.then(computeCluster => computeCluster.id),
* });
* const vm = new vsphere.VirtualMachine("vm", {
* name: "virtual-machine-test",
* resourcePoolId: vappContainer.id,
* datastoreId: datastore.then(datastore => datastore.id),
* numCpus: 2,
* memory: 1024,
* guestId: "ubuntu64Guest",
* disks: [{
* label: "disk0",
* size: 1,
* }],
* networkInterfaces: [{
* networkId: network.then(network => network.id),
* }],
* });
* const vappEntity = new vsphere.VappEntity("vapp_entity", {
* targetId: vm.moid,
* containerId: vappContainer.id,
* startAction: "none",
* });
* ```
*
* ## Import
*
* An existing vApp entity can be imported into this resource via
*
* the ID of the vApp Entity.
*
* [docs-import]: https://developer.hashicorp.com/terraform/cli/import
*
* ```sh
* $ pulumi import vsphere:index/vappEntity:VappEntity vapp_entity vm-123:res-456
* ```
*
* The above would import the vApp entity that governs the behavior of the virtual
*
* machine with a [managed object ID][docs-about-morefs] of vm-123 in the vApp
*
* container with the [managed object ID][docs-about-morefs] res-456.
*/
export declare class VappEntity extends pulumi.CustomResource {
/**
* Get an existing VappEntity 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?: VappEntityState, opts?: pulumi.CustomResourceOptions): VappEntity;
/**
* Returns true if the given object is an instance of VappEntity. 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 VappEntity;
/**
* Managed object ID of the vApp
* container the entity is a member of.
*/
readonly containerId: pulumi.Output<string>;
/**
* A list of custom attributes to set on this resource.
*/
readonly customAttributes: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* How to start the entity. Valid settings are none
* or powerOn. If set to none, then the entity does not participate in auto-start.
* Default: powerOn
*/
readonly startAction: pulumi.Output<string | undefined>;
/**
* Delay in seconds before continuing with the next
* entity in the order of entities to be started. Default: 120
*/
readonly startDelay: pulumi.Output<number | undefined>;
/**
* Order to start and stop target in vApp. Default: 1
*/
readonly startOrder: pulumi.Output<number | undefined>;
/**
* Defines the stop action for the entity. Can be set
* to none, powerOff, guestShutdown, or suspend. If set to none, then the entity
* does not participate in auto-stop. Default: powerOff
*/
readonly stopAction: pulumi.Output<string | undefined>;
/**
* Delay in seconds before continuing with the next
* entity in the order sequence. This is only used if the stopAction is
* guestShutdown. Default: 120
*/
readonly stopDelay: pulumi.Output<number | undefined>;
/**
* A list of tag IDs to apply to this object.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* Managed object ID of the entity
* to power on or power off. This can be a virtual machine or a vApp.
*/
readonly targetId: pulumi.Output<string>;
/**
* Determines if the VM should be marked as being
* started when VMware Tools are ready instead of waiting for `startDelay`. This
* property has no effect for vApps. Default: false
*/
readonly waitForGuest: pulumi.Output<boolean | undefined>;
/**
* Create a VappEntity 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: VappEntityArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering VappEntity resources.
*/
export interface VappEntityState {
/**
* Managed object ID of the vApp
* container the entity is a member of.
*/
containerId?: pulumi.Input<string>;
/**
* A list of custom attributes to set on this resource.
*/
customAttributes?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* How to start the entity. Valid settings are none
* or powerOn. If set to none, then the entity does not participate in auto-start.
* Default: powerOn
*/
startAction?: pulumi.Input<string>;
/**
* Delay in seconds before continuing with the next
* entity in the order of entities to be started. Default: 120
*/
startDelay?: pulumi.Input<number>;
/**
* Order to start and stop target in vApp. Default: 1
*/
startOrder?: pulumi.Input<number>;
/**
* Defines the stop action for the entity. Can be set
* to none, powerOff, guestShutdown, or suspend. If set to none, then the entity
* does not participate in auto-stop. Default: powerOff
*/
stopAction?: pulumi.Input<string>;
/**
* Delay in seconds before continuing with the next
* entity in the order sequence. This is only used if the stopAction is
* guestShutdown. Default: 120
*/
stopDelay?: pulumi.Input<number>;
/**
* A list of tag IDs to apply to this object.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Managed object ID of the entity
* to power on or power off. This can be a virtual machine or a vApp.
*/
targetId?: pulumi.Input<string>;
/**
* Determines if the VM should be marked as being
* started when VMware Tools are ready instead of waiting for `startDelay`. This
* property has no effect for vApps. Default: false
*/
waitForGuest?: pulumi.Input<boolean>;
}
/**
* The set of arguments for constructing a VappEntity resource.
*/
export interface VappEntityArgs {
/**
* Managed object ID of the vApp
* container the entity is a member of.
*/
containerId: pulumi.Input<string>;
/**
* A list of custom attributes to set on this resource.
*/
customAttributes?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* How to start the entity. Valid settings are none
* or powerOn. If set to none, then the entity does not participate in auto-start.
* Default: powerOn
*/
startAction?: pulumi.Input<string>;
/**
* Delay in seconds before continuing with the next
* entity in the order of entities to be started. Default: 120
*/
startDelay?: pulumi.Input<number>;
/**
* Order to start and stop target in vApp. Default: 1
*/
startOrder?: pulumi.Input<number>;
/**
* Defines the stop action for the entity. Can be set
* to none, powerOff, guestShutdown, or suspend. If set to none, then the entity
* does not participate in auto-stop. Default: powerOff
*/
stopAction?: pulumi.Input<string>;
/**
* Delay in seconds before continuing with the next
* entity in the order sequence. This is only used if the stopAction is
* guestShutdown. Default: 120
*/
stopDelay?: pulumi.Input<number>;
/**
* A list of tag IDs to apply to this object.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Managed object ID of the entity
* to power on or power off. This can be a virtual machine or a vApp.
*/
targetId: pulumi.Input<string>;
/**
* Determines if the VM should be marked as being
* started when VMware Tools are ready instead of waiting for `startDelay`. This
* property has no effect for vApps. Default: false
*/
waitForGuest?: pulumi.Input<boolean>;
}