import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Manages an LXC container on a Proxmox VE node. * * A container's root filesystem (the `disk` block) and any additional volumes * (`mountPoint` blocks) can be placed on any Proxmox VE storage backend — * directory, LVM, LVM-thin, ZFS, Ceph RBD, NFS, CIFS, or any other storage * configured on the cluster. Bind mounts of arbitrary host directories are * also supported. See the Storage section below for details. * * ## Example Usage * * ### Basic container * * A minimal Ubuntu container with a 4 GB rootfs on `local-lvm`, * DHCP networking, and an SSH key: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve"; * import * as random from "@pulumi/random"; * import * as std from "@pulumi/std"; * import * as tls from "@pulumi/tls"; * * export = async () => { * const ubuntu2504LxcImg = new proxmoxve.download.FileLegacy("ubuntu_2504_lxc_img", { * contentType: "vztmpl", * datastoreId: "local", * nodeName: "first-node", * url: "https://mirrors.servercentral.com/ubuntu-cloud-images/releases/25.04/release/ubuntu-25.04-server-cloudimg-amd64-root.tar.xz", * }); * const ubuntuContainerPassword = new random.RandomPassword("ubuntu_container_password", { * length: 16, * overrideSpecial: "_%@", * special: true, * }); * const ubuntuContainerKey = new tls.PrivateKey("ubuntu_container_key", { * algorithm: "RSA", * rsaBits: 2048, * }); * const ubuntuContainer = new proxmoxve.ContainerLegacy("ubuntu_container", { * description: "Managed by Pulumi", * nodeName: "first-node", * vmId: 1234, * unprivileged: true, * features: { * nesting: true, * }, * initialization: { * hostname: "terraform-provider-proxmox-ubuntu-container", * ipConfigs: [{ * ipv4: { * address: "dhcp", * }, * }], * userAccount: { * keys: [std.trimspaceOutput({ * input: ubuntuContainerKey.publicKeyOpenssh, * }).apply(invoke => invoke.result)], * password: ubuntuContainerPassword.result, * }, * }, * networkInterfaces: [{ * name: "veth0", * }], * disk: { * datastoreId: "local-lvm", * size: 4, * }, * operatingSystem: { * templateFileId: ubuntu2504LxcImg.id, * type: "ubuntu", * }, * startup: { * order: 3, * upDelay: 60, * downDelay: 60, * }, * }); * return { * ubuntuContainerPassword: ubuntuContainerPassword.result, * ubuntuContainerPrivateKey: ubuntuContainerKey.privateKeyPem, * ubuntuContainerPublicKey: ubuntuContainerKey.publicKeyOpenssh, * }; * } * ``` * * ### Custom storage configuration * * This example places the rootfs on a custom storage pool, attaches an * additional volume, mounts an existing volume by ID, and bind-mounts a host * directory. Any Proxmox storage backend (directory, LVM-thin, ZFS, Ceph RBD, * NFS, CIFS) can be referenced by its storage ID: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve"; * * const customStorage = new proxmoxve.ContainerLegacy("custom_storage", { * nodeName: "first-node", * vmId: 1235, * disk: { * datastoreId: "tank-zfs", * size: 32, * }, * mountPoints: [ * { * volume: "local-lvm", * size: "10G", * path: "/mnt/volume", * }, * { * volume: "local-lvm:subvol-108-disk-101", * size: "10G", * path: "/mnt/data", * }, * { * volume: "/mnt/bindmounts/shared", * path: "/mnt/shared", * }, * ], * }); * ``` * * ## Storage * * Containers attach storage through two block types: * * - **`disk`** — the root filesystem (rootfs). Exactly one rootfs per * container; the `datastoreId` argument selects the Proxmox storage pool * it lives on. * - **`mountPoint`** — zero or more additional volumes or bind mounts, * each mounted at a separate `path` inside the container. * * Both block types are backend-agnostic: `datastoreId` (on `disk`) and * `volume` (on `mountPoint`) accept any Proxmox storage ID, regardless of * backend type. Run `pvesm status` on the host or use the * `proxmoxve.getDatastoresLegacy` * data source to list configured storages. * * The `mount_point.volume` attribute accepts three forms: * * | Form | Meaning | Example | * | -------------------------- | -------------------------------------------------------- | ---------------------------------- | * | Storage ID | Allocate a new volume on that storage (requires `size`) | `local-lvm`, `tank-zfs` | * | Storage ID + volume name | Mount an existing volume by its full PVE volume ID | `local-lvm:subvol-108-disk-101` | * | Absolute host path | Bind-mount a host directory (requires `root@pam` auth) | `/mnt/bindmounts/shared` | * * ## Import * * Instances can be imported using the `nodeName` and the `vmId`, e.g., * * ```sh * $ pulumi import proxmoxve:index/containerLegacy:ContainerLegacy ubuntu_container first-node/1234 * ``` */ export declare class ContainerLegacy extends pulumi.CustomResource { /** * Get an existing ContainerLegacy 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, state?: ContainerLegacyState, opts?: pulumi.CustomResourceOptions): ContainerLegacy; /** * Returns true if the given object is an instance of ContainerLegacy. 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 ContainerLegacy; /** * The cloning configuration. */ readonly clone: pulumi.Output; /** * The console configuration. */ readonly console: pulumi.Output; /** * The CPU configuration. */ readonly cpu: pulumi.Output; /** * The description. */ readonly description: pulumi.Output; /** * Device to pass through to the container (multiple blocks supported). */ readonly devicePassthroughs: pulumi.Output; /** * The root filesystem (rootfs) storage configuration. * Selects the Proxmox storage pool the container's root volume is created * on. Backend-agnostic — works with directory, LVM, LVM-thin, ZFS, Ceph * RBD, NFS, and any other configured Proxmox storage. */ readonly disk: pulumi.Output; /** * A map of runtime environment variables for the container init process. */ readonly environmentVariables: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The container feature flags. Changing flags (except nesting) is only allowed for `root@pam` authenticated user. */ readonly features: pulumi.Output; /** * The identifier for a file containing a hook script (needs to be executable, e.g. by using the `proxmox_virtual_environment_file.file_mode` attribute). */ readonly hookScriptFileId: pulumi.Output; /** * UID/GID mapping for unprivileged containers (multiple * blocks supported). These are written as `lxc.idmap` entries in the container * configuration file via SSH, since the Proxmox API does not support writing * `lxc[n]` parameters. */ readonly idmaps: pulumi.Output; /** * The initialization configuration. */ readonly initialization: pulumi.Output; /** * The map of IPv4 addresses per network devices. Returns the first address for each network device, if multiple addresses are assigned. */ readonly ipv4: pulumi.Output<{ [key: string]: string; }>; /** * The map of IPv6 addresses per network device. Returns the first address for each network device, if multiple addresses are assigned. */ readonly ipv6: pulumi.Output<{ [key: string]: string; }>; /** * The memory configuration. */ readonly memory: pulumi.Output; /** * An additional volume mount or host bind mount * (multiple blocks supported). Use this for data volumes, shared * directories, or attaching pre-existing PVE volumes. */ readonly mountPoints: pulumi.Output; /** * A network interface (multiple blocks * supported). */ readonly networkInterfaces: pulumi.Output; /** * The name of the node to assign the container to. */ readonly nodeName: pulumi.Output; /** * The Operating System configuration. */ readonly operatingSystem: pulumi.Output; /** * The identifier for a pool to assign the container to. */ readonly poolId: pulumi.Output; /** * Whether to set the protection flag of the container (defaults to `false`). This will prevent the container itself and its disk for remove/update operations. */ readonly protection: pulumi.Output; /** * Automatically start container when the host * system boots (defaults to `true`). */ readonly startOnBoot: pulumi.Output; /** * Whether to start the container (defaults to `true`). */ readonly started: pulumi.Output; /** * Defines startup and shutdown behavior of the container. */ readonly startup: pulumi.Output; /** * A list of tags the container tags. This is only meta * information (defaults to `[]`). Note: Proxmox always sorts the container tags and set them to lowercase. * If tag contains capital letters, then Proxmox will always report a * difference on the resource. You may use the `ignoreChanges` lifecycle * meta-argument to ignore changes to this attribute. */ readonly tags: pulumi.Output; /** * Whether to create a template (defaults to `false`). */ readonly template: pulumi.Output; /** * Timeout for cloning a container in seconds (defaults to 1800). */ readonly timeoutClone: pulumi.Output; /** * Timeout for creating a container in seconds (defaults to 1800). */ readonly timeoutCreate: pulumi.Output; /** * Timeout for deleting a container in seconds (defaults to 60). */ readonly timeoutDelete: pulumi.Output; /** * Start container timeout * * @deprecated This field is deprecated and will be removed in a future release. An overall operation timeout (`timeoutCreate` / `timeoutClone`) is used instead. */ readonly timeoutStart: pulumi.Output; /** * Timeout for updating a container in seconds (defaults to 1800). */ readonly timeoutUpdate: pulumi.Output; /** * Whether the container runs as unprivileged on the host (defaults to `false`). */ readonly unprivileged: pulumi.Output; /** * The container identifier */ readonly vmId: pulumi.Output; /** * Configuration for waiting for specific IP address types when the container starts. */ readonly waitForIp: pulumi.Output; /** * Create a ContainerLegacy 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: ContainerLegacyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ContainerLegacy resources. */ export interface ContainerLegacyState { /** * The cloning configuration. */ clone?: pulumi.Input; /** * The console configuration. */ console?: pulumi.Input; /** * The CPU configuration. */ cpu?: pulumi.Input; /** * The description. */ description?: pulumi.Input; /** * Device to pass through to the container (multiple blocks supported). */ devicePassthroughs?: pulumi.Input[] | undefined>; /** * The root filesystem (rootfs) storage configuration. * Selects the Proxmox storage pool the container's root volume is created * on. Backend-agnostic — works with directory, LVM, LVM-thin, ZFS, Ceph * RBD, NFS, and any other configured Proxmox storage. */ disk?: pulumi.Input; /** * A map of runtime environment variables for the container init process. */ environmentVariables?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * The container feature flags. Changing flags (except nesting) is only allowed for `root@pam` authenticated user. */ features?: pulumi.Input; /** * The identifier for a file containing a hook script (needs to be executable, e.g. by using the `proxmox_virtual_environment_file.file_mode` attribute). */ hookScriptFileId?: pulumi.Input; /** * UID/GID mapping for unprivileged containers (multiple * blocks supported). These are written as `lxc.idmap` entries in the container * configuration file via SSH, since the Proxmox API does not support writing * `lxc[n]` parameters. */ idmaps?: pulumi.Input[] | undefined>; /** * The initialization configuration. */ initialization?: pulumi.Input; /** * The map of IPv4 addresses per network devices. Returns the first address for each network device, if multiple addresses are assigned. */ ipv4?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * The map of IPv6 addresses per network device. Returns the first address for each network device, if multiple addresses are assigned. */ ipv6?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * The memory configuration. */ memory?: pulumi.Input; /** * An additional volume mount or host bind mount * (multiple blocks supported). Use this for data volumes, shared * directories, or attaching pre-existing PVE volumes. */ mountPoints?: pulumi.Input[] | undefined>; /** * A network interface (multiple blocks * supported). */ networkInterfaces?: pulumi.Input[] | undefined>; /** * The name of the node to assign the container to. */ nodeName?: pulumi.Input; /** * The Operating System configuration. */ operatingSystem?: pulumi.Input; /** * The identifier for a pool to assign the container to. */ poolId?: pulumi.Input; /** * Whether to set the protection flag of the container (defaults to `false`). This will prevent the container itself and its disk for remove/update operations. */ protection?: pulumi.Input; /** * Automatically start container when the host * system boots (defaults to `true`). */ startOnBoot?: pulumi.Input; /** * Whether to start the container (defaults to `true`). */ started?: pulumi.Input; /** * Defines startup and shutdown behavior of the container. */ startup?: pulumi.Input; /** * A list of tags the container tags. This is only meta * information (defaults to `[]`). Note: Proxmox always sorts the container tags and set them to lowercase. * If tag contains capital letters, then Proxmox will always report a * difference on the resource. You may use the `ignoreChanges` lifecycle * meta-argument to ignore changes to this attribute. */ tags?: pulumi.Input[] | undefined>; /** * Whether to create a template (defaults to `false`). */ template?: pulumi.Input; /** * Timeout for cloning a container in seconds (defaults to 1800). */ timeoutClone?: pulumi.Input; /** * Timeout for creating a container in seconds (defaults to 1800). */ timeoutCreate?: pulumi.Input; /** * Timeout for deleting a container in seconds (defaults to 60). */ timeoutDelete?: pulumi.Input; /** * Start container timeout * * @deprecated This field is deprecated and will be removed in a future release. An overall operation timeout (`timeoutCreate` / `timeoutClone`) is used instead. */ timeoutStart?: pulumi.Input; /** * Timeout for updating a container in seconds (defaults to 1800). */ timeoutUpdate?: pulumi.Input; /** * Whether the container runs as unprivileged on the host (defaults to `false`). */ unprivileged?: pulumi.Input; /** * The container identifier */ vmId?: pulumi.Input; /** * Configuration for waiting for specific IP address types when the container starts. */ waitForIp?: pulumi.Input; } /** * The set of arguments for constructing a ContainerLegacy resource. */ export interface ContainerLegacyArgs { /** * The cloning configuration. */ clone?: pulumi.Input; /** * The console configuration. */ console?: pulumi.Input; /** * The CPU configuration. */ cpu?: pulumi.Input; /** * The description. */ description?: pulumi.Input; /** * Device to pass through to the container (multiple blocks supported). */ devicePassthroughs?: pulumi.Input[] | undefined>; /** * The root filesystem (rootfs) storage configuration. * Selects the Proxmox storage pool the container's root volume is created * on. Backend-agnostic — works with directory, LVM, LVM-thin, ZFS, Ceph * RBD, NFS, and any other configured Proxmox storage. */ disk?: pulumi.Input; /** * A map of runtime environment variables for the container init process. */ environmentVariables?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * The container feature flags. Changing flags (except nesting) is only allowed for `root@pam` authenticated user. */ features?: pulumi.Input; /** * The identifier for a file containing a hook script (needs to be executable, e.g. by using the `proxmox_virtual_environment_file.file_mode` attribute). */ hookScriptFileId?: pulumi.Input; /** * UID/GID mapping for unprivileged containers (multiple * blocks supported). These are written as `lxc.idmap` entries in the container * configuration file via SSH, since the Proxmox API does not support writing * `lxc[n]` parameters. */ idmaps?: pulumi.Input[] | undefined>; /** * The initialization configuration. */ initialization?: pulumi.Input; /** * The memory configuration. */ memory?: pulumi.Input; /** * An additional volume mount or host bind mount * (multiple blocks supported). Use this for data volumes, shared * directories, or attaching pre-existing PVE volumes. */ mountPoints?: pulumi.Input[] | undefined>; /** * A network interface (multiple blocks * supported). */ networkInterfaces?: pulumi.Input[] | undefined>; /** * The name of the node to assign the container to. */ nodeName: pulumi.Input; /** * The Operating System configuration. */ operatingSystem?: pulumi.Input; /** * The identifier for a pool to assign the container to. */ poolId?: pulumi.Input; /** * Whether to set the protection flag of the container (defaults to `false`). This will prevent the container itself and its disk for remove/update operations. */ protection?: pulumi.Input; /** * Automatically start container when the host * system boots (defaults to `true`). */ startOnBoot?: pulumi.Input; /** * Whether to start the container (defaults to `true`). */ started?: pulumi.Input; /** * Defines startup and shutdown behavior of the container. */ startup?: pulumi.Input; /** * A list of tags the container tags. This is only meta * information (defaults to `[]`). Note: Proxmox always sorts the container tags and set them to lowercase. * If tag contains capital letters, then Proxmox will always report a * difference on the resource. You may use the `ignoreChanges` lifecycle * meta-argument to ignore changes to this attribute. */ tags?: pulumi.Input[] | undefined>; /** * Whether to create a template (defaults to `false`). */ template?: pulumi.Input; /** * Timeout for cloning a container in seconds (defaults to 1800). */ timeoutClone?: pulumi.Input; /** * Timeout for creating a container in seconds (defaults to 1800). */ timeoutCreate?: pulumi.Input; /** * Timeout for deleting a container in seconds (defaults to 60). */ timeoutDelete?: pulumi.Input; /** * Start container timeout * * @deprecated This field is deprecated and will be removed in a future release. An overall operation timeout (`timeoutCreate` / `timeoutClone`) is used instead. */ timeoutStart?: pulumi.Input; /** * Timeout for updating a container in seconds (defaults to 1800). */ timeoutUpdate?: pulumi.Input; /** * Whether the container runs as unprivileged on the host (defaults to `false`). */ unprivileged?: pulumi.Input; /** * The container identifier */ vmId?: pulumi.Input; /** * Configuration for waiting for specific IP address types when the container starts. */ waitForIp?: pulumi.Input; } //# sourceMappingURL=containerLegacy.d.ts.map