// *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** 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, state?: InstanceState, opts?: pulumi.CustomResourceOptions, ): Instance { return new Instance(name, 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* - The instance architecture (e.g. x86_64, aarch64). See [Architectures](https://linuxcontainers.org/incus/docs/main/architectures/) for all possible values. */ declare public readonly architecture: pulumi.Output; /** * *Optional* - Map of key/value pairs of * [instance config settings](https://linuxcontainers.org/incus/docs/main/reference/instance_options/). */ declare public readonly config: pulumi.Output<{ [key: string]: string }>; /** * *Optional* - Description of the instance. */ declare public readonly description: pulumi.Output; /** * *Optional* - Device definition. See reference below. */ declare public readonly devices: pulumi.Output; /** * *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`. */ declare public readonly ephemeral: pulumi.Output; /** * *Optional* - File to upload to the instance. See reference below. */ declare public readonly files: pulumi.Output; /** * *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/). */ declare public readonly image: pulumi.Output; /** * The IPv4 Address of the instance. See Instance Network * Access for more details. */ declare public readonly /*out*/ ipv4Address: pulumi.Output; /** * The IPv6 Address of the instance. See Instance Network * Access for more details. */ declare public readonly /*out*/ ipv6Address: pulumi.Output; /** * The MAC address of the detected NIC. See Instance Network * Access for more details. */ declare public readonly /*out*/ macAddress: pulumi.Output; /** * **Required** - Name of the instance. */ declare public readonly name: pulumi.Output; /** * *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. */ declare public readonly profiles: pulumi.Output; /** * *Optional* - Name of the project where the instance will be spawned. */ declare public readonly project: pulumi.Output; /** * *Optional* - The remote in which the resource will be created. If * not provided, the provider's default remote will be used. */ declare public readonly remote: pulumi.Output; /** * *Optional* - Boolean indicating whether the instance should be started (running). Defaults to `true`. */ declare public readonly running: pulumi.Output; /** * *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples. */ declare public readonly sourceFile: pulumi.Output; /** * *Optional* - The source instance from which the instance will be created. See reference below. */ declare public readonly sourceInstance: pulumi.Output< outputs.InstanceSourceInstance | undefined >; /** * The status of the instance. */ declare public readonly /*out*/ status: pulumi.Output; /** * *Optional* - Specify a target node in a cluster. */ declare public readonly target: pulumi.Output; /** * *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`. */ declare public readonly type: pulumi.Output; /** * *Optional* - WaitFor definition. See reference below. * If `running` is set to false or instance is already running (on update), this value has no effect. */ declare public readonly waitFors: pulumi.Output; /** * 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["architecture"] = state?.architecture; resourceInputs["config"] = state?.config; resourceInputs["description"] = state?.description; resourceInputs["devices"] = state?.devices; resourceInputs["ephemeral"] = state?.ephemeral; resourceInputs["files"] = state?.files; resourceInputs["image"] = state?.image; resourceInputs["ipv4Address"] = state?.ipv4Address; resourceInputs["ipv6Address"] = state?.ipv6Address; resourceInputs["macAddress"] = state?.macAddress; resourceInputs["name"] = state?.name; resourceInputs["profiles"] = state?.profiles; resourceInputs["project"] = state?.project; resourceInputs["remote"] = state?.remote; resourceInputs["running"] = state?.running; resourceInputs["sourceFile"] = state?.sourceFile; resourceInputs["sourceInstance"] = state?.sourceInstance; resourceInputs["status"] = state?.status; resourceInputs["target"] = state?.target; resourceInputs["type"] = state?.type; resourceInputs["waitFors"] = state?.waitFors; } else { const args = argsOrState as InstanceArgs | undefined; if (args?.name === undefined && !opts.urn) { throw new Error("Missing required property 'name'"); } resourceInputs["architecture"] = args?.architecture; resourceInputs["config"] = args?.config; resourceInputs["description"] = args?.description; resourceInputs["devices"] = args?.devices; resourceInputs["ephemeral"] = args?.ephemeral; resourceInputs["files"] = args?.files; resourceInputs["image"] = args?.image; resourceInputs["name"] = args?.name; resourceInputs["profiles"] = args?.profiles; resourceInputs["project"] = args?.project ?? "default"; resourceInputs["remote"] = args?.remote; resourceInputs["running"] = args?.running; resourceInputs["sourceFile"] = args?.sourceFile; resourceInputs["sourceInstance"] = args?.sourceInstance; resourceInputs["target"] = args?.target; resourceInputs["type"] = args?.type; resourceInputs["waitFors"] = args?.waitFors; 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* - The instance architecture (e.g. x86_64, aarch64). See [Architectures](https://linuxcontainers.org/incus/docs/main/architectures/) for all possible values. */ architecture?: pulumi.Input; /** * *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 }>; /** * *Optional* - Description of the instance. */ description?: pulumi.Input; /** * *Optional* - Device definition. See reference below. */ devices?: pulumi.Input[]>; /** * *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`. */ ephemeral?: pulumi.Input; /** * *Optional* - File to upload to the instance. See reference below. */ files?: pulumi.Input[]>; /** * *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; /** * The IPv4 Address of the instance. See Instance Network * Access for more details. */ ipv4Address?: pulumi.Input; /** * The IPv6 Address of the instance. See Instance Network * Access for more details. */ ipv6Address?: pulumi.Input; /** * The MAC address of the detected NIC. See Instance Network * Access for more details. */ macAddress?: pulumi.Input; /** * **Required** - Name of the instance. */ name?: pulumi.Input; /** * *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[]>; /** * *Optional* - Name of the project where the instance will be spawned. */ project?: pulumi.Input; /** * *Optional* - The remote in which the resource will be created. If * not provided, the provider's default remote will be used. */ remote?: pulumi.Input; /** * *Optional* - Boolean indicating whether the instance should be started (running). Defaults to `true`. */ running?: pulumi.Input; /** * *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples. */ sourceFile?: pulumi.Input; /** * *Optional* - The source instance from which the instance will be created. See reference below. */ sourceInstance?: pulumi.Input; /** * The status of the instance. */ status?: pulumi.Input; /** * *Optional* - Specify a target node in a cluster. */ target?: pulumi.Input; /** * *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`. */ type?: pulumi.Input; /** * *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[]>; } /** * The set of arguments for constructing a Instance resource. */ export interface InstanceArgs { /** * *Optional* - The instance architecture (e.g. x86_64, aarch64). See [Architectures](https://linuxcontainers.org/incus/docs/main/architectures/) for all possible values. */ architecture?: pulumi.Input; /** * *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 }>; /** * *Optional* - Description of the instance. */ description?: pulumi.Input; /** * *Optional* - Device definition. See reference below. */ devices?: pulumi.Input[]>; /** * *Optional* - Boolean indicating if this instance is ephemeral. Defaults to `false`. */ ephemeral?: pulumi.Input; /** * *Optional* - File to upload to the instance. See reference below. */ files?: pulumi.Input[]>; /** * *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; /** * **Required** - Name of the instance. */ name: pulumi.Input; /** * *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[]>; /** * *Optional* - Name of the project where the instance will be spawned. */ project?: pulumi.Input; /** * *Optional* - The remote in which the resource will be created. If * not provided, the provider's default remote will be used. */ remote?: pulumi.Input; /** * *Optional* - Boolean indicating whether the instance should be started (running). Defaults to `true`. */ running?: pulumi.Input; /** * *Optional* - The souce backup file from which the instance should be restored. For handling of storage pool, see examples. */ sourceFile?: pulumi.Input; /** * *Optional* - The source instance from which the instance will be created. See reference below. */ sourceInstance?: pulumi.Input; /** * *Optional* - Specify a target node in a cluster. */ target?: pulumi.Input; /** * *Optional* - Instance type. Can be `container`, or `virtual-machine`. Defaults to `container`. */ type?: pulumi.Input; /** * *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[]>; }