@pulumi/libvirt
Version:
A Pulumi package for creating and managing libvirt cloud resources.
394 lines (393 loc) • 15.8 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Manages a VM domain resource within libvirt. For more information see
* [the official documentation](https://libvirt.org/formatdomain.html).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as libvirt from "@pulumi/libvirt";
*
* const _default = new libvirt.Domain("default", {name: "test"});
* ```
*/
export declare class Domain extends pulumi.CustomResource {
/**
* Get an existing Domain 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?: DomainState, opts?: pulumi.CustomResourceOptions): Domain;
/**
* Returns true if the given object is an instance of Domain. 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 Domain;
/**
* The architecture for the VM (probably x8664 or i686),
* you normally won't need to set this unless you are building a special VM
*/
readonly arch: pulumi.Output<string>;
/**
* Set to `true` to start the domain on host boot up.
* If not specified `false` is assumed.
*/
readonly autostart: pulumi.Output<boolean>;
/**
* A list of devices (dev) which defines boot order. Example
* below.
*/
readonly bootDevices: pulumi.Output<outputs.DomainBootDevice[] | undefined>;
/**
* The `libvirt.CloudInitDisk` disk that has to be used by
* the domain. This is going to be attached as a CDROM ISO. Changing the
* cloud-init won't cause the domain to be recreated, however the change will
* have effect on the next reboot.
*/
readonly cloudinit: pulumi.Output<string | undefined>;
readonly cmdlines: pulumi.Output<{
[key: string]: string;
}[] | undefined>;
readonly consoles: pulumi.Output<outputs.DomainConsole[] | undefined>;
/**
* The
* [libvirt.Ignition](https://www.terraform.io/docs/providers/libvirt/r/coreos_ignition.html) resource
* that is to be used by the CoreOS domain.
*/
readonly coreosIgnition: pulumi.Output<string | undefined>;
/**
* Configures CPU mode. See below for more
* details.
*/
readonly cpu: pulumi.Output<outputs.DomainCpu>;
/**
* The description for domain.
* Changing this forces a new resource to be created.
* This data is not used by libvirt in any way, it can contain any information the user wants.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* An array of one or more disks to attach to the domain. The
* `disk` object structure is documented below.
*/
readonly disks: pulumi.Output<outputs.DomainDisk[] | undefined>;
/**
* The path of the emulator to use
*/
readonly emulator: pulumi.Output<string>;
/**
* An array of one or more host filesystems to attach to
* the domain. The `filesystem` object structure is documented
* below.
*/
readonly filesystems: pulumi.Output<outputs.DomainFilesystem[] | undefined>;
readonly firmware: pulumi.Output<string | undefined>;
/**
* The name of the firmware config path where ignition file is stored: default is `opt/com.coreos/config`. If you are using [Flatcar Linux](https://docs.flatcar-linux.org/os/booting-with-libvirt/#creating-the-domain-xml), the value is `opt/org.flatcar-linux/config`.
*/
readonly fwCfgName: pulumi.Output<string | undefined>;
readonly graphics: pulumi.Output<outputs.DomainGraphics | undefined>;
readonly initrd: pulumi.Output<string | undefined>;
readonly kernel: pulumi.Output<string | undefined>;
/**
* The machine type,
* you normally won't need to set this unless you are running on a platform that
* defaults to the wrong machine type for your template
*/
readonly machine: pulumi.Output<string>;
/**
* The amount of memory in MiB. If not specified the domain
* will be created with 512 MiB of memory be used.
*/
readonly memory: pulumi.Output<number | undefined>;
readonly metadata: pulumi.Output<string | undefined>;
/**
* A unique name for the resource, required by libvirt.
* Changing this forces a new resource to be created.
*/
readonly name: pulumi.Output<string>;
/**
* An array of one or more network interfaces to
* attach to the domain. The `networkInterface` object structure is documented
* below.
*/
readonly networkInterfaces: pulumi.Output<outputs.DomainNetworkInterface[] | undefined>;
readonly nvram: pulumi.Output<outputs.DomainNvram>;
/**
* By default is disabled, set to true for enabling it. More info [qemu-agent](https://wiki.libvirt.org/page/Qemu_guest_agent).
*/
readonly qemuAgent: pulumi.Output<boolean | undefined>;
/**
* Use `false` to turn off the instance. If not specified,
* true is assumed and the instance, if stopped, will be started at next apply.
*/
readonly running: pulumi.Output<boolean | undefined>;
/**
* TPM device to attach to the domain. The `tpm` object structure is documented below.
*/
readonly tpm: pulumi.Output<outputs.DomainTpm | undefined>;
/**
* The type of hypervisor to use for the domain. Defaults to `kvm`, other values can be found [here](https://libvirt.org/formatdomain.html#id1)
*/
readonly type: pulumi.Output<string | undefined>;
/**
* The amount of virtual CPUs. If not specified, a single CPU
* will be created.
*/
readonly vcpu: pulumi.Output<number | undefined>;
readonly video: pulumi.Output<outputs.DomainVideo | undefined>;
readonly xml: pulumi.Output<outputs.DomainXml | undefined>;
/**
* Create a Domain 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?: DomainArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Domain resources.
*/
export interface DomainState {
/**
* The architecture for the VM (probably x8664 or i686),
* you normally won't need to set this unless you are building a special VM
*/
arch?: pulumi.Input<string>;
/**
* Set to `true` to start the domain on host boot up.
* If not specified `false` is assumed.
*/
autostart?: pulumi.Input<boolean>;
/**
* A list of devices (dev) which defines boot order. Example
* below.
*/
bootDevices?: pulumi.Input<pulumi.Input<inputs.DomainBootDevice>[]>;
/**
* The `libvirt.CloudInitDisk` disk that has to be used by
* the domain. This is going to be attached as a CDROM ISO. Changing the
* cloud-init won't cause the domain to be recreated, however the change will
* have effect on the next reboot.
*/
cloudinit?: pulumi.Input<string>;
cmdlines?: pulumi.Input<pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>[]>;
consoles?: pulumi.Input<pulumi.Input<inputs.DomainConsole>[]>;
/**
* The
* [libvirt.Ignition](https://www.terraform.io/docs/providers/libvirt/r/coreos_ignition.html) resource
* that is to be used by the CoreOS domain.
*/
coreosIgnition?: pulumi.Input<string>;
/**
* Configures CPU mode. See below for more
* details.
*/
cpu?: pulumi.Input<inputs.DomainCpu>;
/**
* The description for domain.
* Changing this forces a new resource to be created.
* This data is not used by libvirt in any way, it can contain any information the user wants.
*/
description?: pulumi.Input<string>;
/**
* An array of one or more disks to attach to the domain. The
* `disk` object structure is documented below.
*/
disks?: pulumi.Input<pulumi.Input<inputs.DomainDisk>[]>;
/**
* The path of the emulator to use
*/
emulator?: pulumi.Input<string>;
/**
* An array of one or more host filesystems to attach to
* the domain. The `filesystem` object structure is documented
* below.
*/
filesystems?: pulumi.Input<pulumi.Input<inputs.DomainFilesystem>[]>;
firmware?: pulumi.Input<string>;
/**
* The name of the firmware config path where ignition file is stored: default is `opt/com.coreos/config`. If you are using [Flatcar Linux](https://docs.flatcar-linux.org/os/booting-with-libvirt/#creating-the-domain-xml), the value is `opt/org.flatcar-linux/config`.
*/
fwCfgName?: pulumi.Input<string>;
graphics?: pulumi.Input<inputs.DomainGraphics>;
initrd?: pulumi.Input<string>;
kernel?: pulumi.Input<string>;
/**
* The machine type,
* you normally won't need to set this unless you are running on a platform that
* defaults to the wrong machine type for your template
*/
machine?: pulumi.Input<string>;
/**
* The amount of memory in MiB. If not specified the domain
* will be created with 512 MiB of memory be used.
*/
memory?: pulumi.Input<number>;
metadata?: pulumi.Input<string>;
/**
* A unique name for the resource, required by libvirt.
* Changing this forces a new resource to be created.
*/
name?: pulumi.Input<string>;
/**
* An array of one or more network interfaces to
* attach to the domain. The `networkInterface` object structure is documented
* below.
*/
networkInterfaces?: pulumi.Input<pulumi.Input<inputs.DomainNetworkInterface>[]>;
nvram?: pulumi.Input<inputs.DomainNvram>;
/**
* By default is disabled, set to true for enabling it. More info [qemu-agent](https://wiki.libvirt.org/page/Qemu_guest_agent).
*/
qemuAgent?: pulumi.Input<boolean>;
/**
* Use `false` to turn off the instance. If not specified,
* true is assumed and the instance, if stopped, will be started at next apply.
*/
running?: pulumi.Input<boolean>;
/**
* TPM device to attach to the domain. The `tpm` object structure is documented below.
*/
tpm?: pulumi.Input<inputs.DomainTpm>;
/**
* The type of hypervisor to use for the domain. Defaults to `kvm`, other values can be found [here](https://libvirt.org/formatdomain.html#id1)
*/
type?: pulumi.Input<string>;
/**
* The amount of virtual CPUs. If not specified, a single CPU
* will be created.
*/
vcpu?: pulumi.Input<number>;
video?: pulumi.Input<inputs.DomainVideo>;
xml?: pulumi.Input<inputs.DomainXml>;
}
/**
* The set of arguments for constructing a Domain resource.
*/
export interface DomainArgs {
/**
* The architecture for the VM (probably x8664 or i686),
* you normally won't need to set this unless you are building a special VM
*/
arch?: pulumi.Input<string>;
/**
* Set to `true` to start the domain on host boot up.
* If not specified `false` is assumed.
*/
autostart?: pulumi.Input<boolean>;
/**
* A list of devices (dev) which defines boot order. Example
* below.
*/
bootDevices?: pulumi.Input<pulumi.Input<inputs.DomainBootDevice>[]>;
/**
* The `libvirt.CloudInitDisk` disk that has to be used by
* the domain. This is going to be attached as a CDROM ISO. Changing the
* cloud-init won't cause the domain to be recreated, however the change will
* have effect on the next reboot.
*/
cloudinit?: pulumi.Input<string>;
cmdlines?: pulumi.Input<pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>[]>;
consoles?: pulumi.Input<pulumi.Input<inputs.DomainConsole>[]>;
/**
* The
* [libvirt.Ignition](https://www.terraform.io/docs/providers/libvirt/r/coreos_ignition.html) resource
* that is to be used by the CoreOS domain.
*/
coreosIgnition?: pulumi.Input<string>;
/**
* Configures CPU mode. See below for more
* details.
*/
cpu?: pulumi.Input<inputs.DomainCpu>;
/**
* The description for domain.
* Changing this forces a new resource to be created.
* This data is not used by libvirt in any way, it can contain any information the user wants.
*/
description?: pulumi.Input<string>;
/**
* An array of one or more disks to attach to the domain. The
* `disk` object structure is documented below.
*/
disks?: pulumi.Input<pulumi.Input<inputs.DomainDisk>[]>;
/**
* The path of the emulator to use
*/
emulator?: pulumi.Input<string>;
/**
* An array of one or more host filesystems to attach to
* the domain. The `filesystem` object structure is documented
* below.
*/
filesystems?: pulumi.Input<pulumi.Input<inputs.DomainFilesystem>[]>;
firmware?: pulumi.Input<string>;
/**
* The name of the firmware config path where ignition file is stored: default is `opt/com.coreos/config`. If you are using [Flatcar Linux](https://docs.flatcar-linux.org/os/booting-with-libvirt/#creating-the-domain-xml), the value is `opt/org.flatcar-linux/config`.
*/
fwCfgName?: pulumi.Input<string>;
graphics?: pulumi.Input<inputs.DomainGraphics>;
initrd?: pulumi.Input<string>;
kernel?: pulumi.Input<string>;
/**
* The machine type,
* you normally won't need to set this unless you are running on a platform that
* defaults to the wrong machine type for your template
*/
machine?: pulumi.Input<string>;
/**
* The amount of memory in MiB. If not specified the domain
* will be created with 512 MiB of memory be used.
*/
memory?: pulumi.Input<number>;
metadata?: pulumi.Input<string>;
/**
* A unique name for the resource, required by libvirt.
* Changing this forces a new resource to be created.
*/
name?: pulumi.Input<string>;
/**
* An array of one or more network interfaces to
* attach to the domain. The `networkInterface` object structure is documented
* below.
*/
networkInterfaces?: pulumi.Input<pulumi.Input<inputs.DomainNetworkInterface>[]>;
nvram?: pulumi.Input<inputs.DomainNvram>;
/**
* By default is disabled, set to true for enabling it. More info [qemu-agent](https://wiki.libvirt.org/page/Qemu_guest_agent).
*/
qemuAgent?: pulumi.Input<boolean>;
/**
* Use `false` to turn off the instance. If not specified,
* true is assumed and the instance, if stopped, will be started at next apply.
*/
running?: pulumi.Input<boolean>;
/**
* TPM device to attach to the domain. The `tpm` object structure is documented below.
*/
tpm?: pulumi.Input<inputs.DomainTpm>;
/**
* The type of hypervisor to use for the domain. Defaults to `kvm`, other values can be found [here](https://libvirt.org/formatdomain.html#id1)
*/
type?: pulumi.Input<string>;
/**
* The amount of virtual CPUs. If not specified, a single CPU
* will be created.
*/
vcpu?: pulumi.Input<number>;
video?: pulumi.Input<inputs.DomainVideo>;
xml?: pulumi.Input<inputs.DomainXml>;
}