Files
pulumi-incus/sdk/nodejs/instance.ts
2025-04-24 21:09:04 -04:00

358 lines
15 KiB
TypeScript
Generated

// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
import * as utilities from "./utilities";
export class Instance extends pulumi.CustomResource {
/**
* Get an existing Instance 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.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InstanceState, opts?: pulumi.CustomResourceOptions): Instance {
return new Instance(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/instance:Instance';
/**
* Returns true if the given object is an instance of Instance. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is Instance {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Instance.__pulumiType;
}
/**
* *Optional* - Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
public readonly config!: pulumi.Output<{[key: string]: string}>;
/**
* *Optional* - Description of the instance.
*/
public readonly description!: pulumi.Output<string>;
/**
* *Optional* - Device definition. See reference below.
*/
public readonly devices!: pulumi.Output<outputs.InstanceDevice[] | undefined>;
/**
* *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`.
*/
public readonly ephemeral!: pulumi.Output<boolean>;
/**
* *Optional* - File to upload to the instance. See reference below.
*/
public readonly files!: pulumi.Output<outputs.InstanceFile[] | undefined>;
/**
* *Optional* - Base image from which the instance will be created. Must
* specify [an image accessible from the provider remote](https://linuxcontainers.org/incus/docs/main/reference/image_servers/).
*/
public readonly image!: pulumi.Output<string | undefined>;
/**
* The IPv4 Address of the instance. See Instance Network
* Access for more details.
*/
public /*out*/ readonly ipv4Address!: pulumi.Output<string>;
/**
* The IPv6 Address of the instance. See Instance Network
* Access for more details.
*/
public /*out*/ readonly ipv6Address!: pulumi.Output<string>;
/**
* The MAC address of the detected NIC. See Instance Network
* Access for more details.
*/
public /*out*/ readonly macAddress!: pulumi.Output<string>;
/**
* **Required** - Name of the instance.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - List of Incus config profiles to apply to the new
* instance. Profile `default` will be applied if profiles are not set (are `null`).
* However, if an empty array (`[]`) is set as a value, no profiles will be applied.
*/
public readonly profiles!: pulumi.Output<string[]>;
/**
* *Optional* - Name of the project where the instance will be spawned.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* *Optional* - Boolean indicating whether the instance should be started (running). Defaults to `true`.
*/
public readonly running!: pulumi.Output<boolean>;
/**
* *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples.
*/
public readonly sourceFile!: pulumi.Output<string | undefined>;
/**
* *Optional* - The source instance from which the instance will be created. See reference below.
*/
public readonly sourceInstance!: pulumi.Output<outputs.InstanceSourceInstance | undefined>;
/**
* The status of the instance.
*/
public /*out*/ readonly status!: pulumi.Output<string>;
/**
* *Optional* - Specify a target node in a cluster.
*/
public readonly target!: pulumi.Output<string>;
/**
* *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`.
*/
public readonly type!: pulumi.Output<string>;
/**
* *Optional* - WaitFor definition. See reference below.
* If `running` is set to false or instance is already running (on update), this value has no effect.
*/
public readonly waitFors!: pulumi.Output<outputs.InstanceWaitFor[] | undefined>;
/**
* Create a Instance 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?: InstanceArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: InstanceArgs | InstanceState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as InstanceState | undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["devices"] = state ? state.devices : undefined;
resourceInputs["ephemeral"] = state ? state.ephemeral : undefined;
resourceInputs["files"] = state ? state.files : undefined;
resourceInputs["image"] = state ? state.image : undefined;
resourceInputs["ipv4Address"] = state ? state.ipv4Address : undefined;
resourceInputs["ipv6Address"] = state ? state.ipv6Address : undefined;
resourceInputs["macAddress"] = state ? state.macAddress : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["profiles"] = state ? state.profiles : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["running"] = state ? state.running : undefined;
resourceInputs["sourceFile"] = state ? state.sourceFile : undefined;
resourceInputs["sourceInstance"] = state ? state.sourceInstance : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["target"] = state ? state.target : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["waitFors"] = state ? state.waitFors : undefined;
} else {
const args = argsOrState as InstanceArgs | undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["devices"] = args ? args.devices : undefined;
resourceInputs["ephemeral"] = args ? args.ephemeral : undefined;
resourceInputs["files"] = args ? args.files : undefined;
resourceInputs["image"] = args ? args.image : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["profiles"] = args ? args.profiles : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["running"] = args ? args.running : undefined;
resourceInputs["sourceFile"] = args ? args.sourceFile : undefined;
resourceInputs["sourceInstance"] = args ? args.sourceInstance : undefined;
resourceInputs["target"] = args ? args.target : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["waitFors"] = args ? args.waitFors : undefined;
resourceInputs["ipv4Address"] = undefined /*out*/;
resourceInputs["ipv6Address"] = undefined /*out*/;
resourceInputs["macAddress"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Instance.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering Instance resources.
*/
export interface InstanceState {
/**
* *Optional* - Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the instance.
*/
description?: pulumi.Input<string>;
/**
* *Optional* - Device definition. See reference below.
*/
devices?: pulumi.Input<pulumi.Input<inputs.InstanceDevice>[]>;
/**
* *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`.
*/
ephemeral?: pulumi.Input<boolean>;
/**
* *Optional* - File to upload to the instance. See reference below.
*/
files?: pulumi.Input<pulumi.Input<inputs.InstanceFile>[]>;
/**
* *Optional* - Base image from which the instance will be created. Must
* specify [an image accessible from the provider remote](https://linuxcontainers.org/incus/docs/main/reference/image_servers/).
*/
image?: pulumi.Input<string>;
/**
* The IPv4 Address of the instance. See Instance Network
* Access for more details.
*/
ipv4Address?: pulumi.Input<string>;
/**
* The IPv6 Address of the instance. See Instance Network
* Access for more details.
*/
ipv6Address?: pulumi.Input<string>;
/**
* The MAC address of the detected NIC. See Instance Network
* Access for more details.
*/
macAddress?: pulumi.Input<string>;
/**
* **Required** - Name of the instance.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - List of Incus config profiles to apply to the new
* instance. Profile `default` will be applied if profiles are not set (are `null`).
* However, if an empty array (`[]`) is set as a value, no profiles will be applied.
*/
profiles?: pulumi.Input<pulumi.Input<string>[]>;
/**
* *Optional* - Name of the project where the instance will be spawned.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Boolean indicating whether the instance should be started (running). Defaults to `true`.
*/
running?: pulumi.Input<boolean>;
/**
* *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples.
*/
sourceFile?: pulumi.Input<string>;
/**
* *Optional* - The source instance from which the instance will be created. See reference below.
*/
sourceInstance?: pulumi.Input<inputs.InstanceSourceInstance>;
/**
* The status of the instance.
*/
status?: pulumi.Input<string>;
/**
* *Optional* - Specify a target node in a cluster.
*/
target?: pulumi.Input<string>;
/**
* *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`.
*/
type?: pulumi.Input<string>;
/**
* *Optional* - WaitFor definition. See reference below.
* If `running` is set to false or instance is already running (on update), this value has no effect.
*/
waitFors?: pulumi.Input<pulumi.Input<inputs.InstanceWaitFor>[]>;
}
/**
* The set of arguments for constructing a Instance resource.
*/
export interface InstanceArgs {
/**
* *Optional* - Map of key/value pairs of
* [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/).
*/
config?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
/**
* *Optional* - Description of the instance.
*/
description?: pulumi.Input<string>;
/**
* *Optional* - Device definition. See reference below.
*/
devices?: pulumi.Input<pulumi.Input<inputs.InstanceDevice>[]>;
/**
* *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`.
*/
ephemeral?: pulumi.Input<boolean>;
/**
* *Optional* - File to upload to the instance. See reference below.
*/
files?: pulumi.Input<pulumi.Input<inputs.InstanceFile>[]>;
/**
* *Optional* - Base image from which the instance will be created. Must
* specify [an image accessible from the provider remote](https://linuxcontainers.org/incus/docs/main/reference/image_servers/).
*/
image?: pulumi.Input<string>;
/**
* **Required** - Name of the instance.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - List of Incus config profiles to apply to the new
* instance. Profile `default` will be applied if profiles are not set (are `null`).
* However, if an empty array (`[]`) is set as a value, no profiles will be applied.
*/
profiles?: pulumi.Input<pulumi.Input<string>[]>;
/**
* *Optional* - Name of the project where the instance will be spawned.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Boolean indicating whether the instance should be started (running). Defaults to `true`.
*/
running?: pulumi.Input<boolean>;
/**
* *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples.
*/
sourceFile?: pulumi.Input<string>;
/**
* *Optional* - The source instance from which the instance will be created. See reference below.
*/
sourceInstance?: pulumi.Input<inputs.InstanceSourceInstance>;
/**
* *Optional* - Specify a target node in a cluster.
*/
target?: pulumi.Input<string>;
/**
* *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`.
*/
type?: pulumi.Input<string>;
/**
* *Optional* - WaitFor definition. See reference below.
* If `running` is set to false or instance is already running (on update), this value has no effect.
*/
waitFors?: pulumi.Input<pulumi.Input<inputs.InstanceWaitFor>[]>;
}