UNPKG

@lbrlabs/pulumi-scaleway

Version:

A Pulumi package for creating and managing scaleway cloud resources.

226 lines (225 loc) 7.36 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Creates and manages Scaleway Compute Snapshots. * For more information, * see [the documentation](https://developers.scaleway.com/en/products/instance/api/#snapshots-756fae). * * ## Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const main = new scaleway.InstanceSnapshot("main", {volumeId: "11111111-1111-1111-1111-111111111111"}); * ``` * * ## Example with Unified type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const mainInstanceVolume = new scaleway.InstanceVolume("mainInstanceVolume", { * type: "l_ssd", * sizeInGb: 10, * }); * const mainInstanceServer = new scaleway.InstanceServer("mainInstanceServer", { * image: "ubuntu_jammy", * type: "DEV1-S", * rootVolume: { * sizeInGb: 10, * volumeType: "l_ssd", * }, * additionalVolumeIds: [mainInstanceVolume.id], * }); * const mainInstanceSnapshot = new scaleway.InstanceSnapshot("mainInstanceSnapshot", { * volumeId: mainInstanceVolume.id, * type: "unified", * }, { * dependsOn: [mainInstanceServer], * }); * ``` * * ## Import a local qcow2 file * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const bucket = new scaleway.ObjectBucket("bucket", {}); * const qcow = new scaleway.ObjectItem("qcow", { * bucket: bucket.name, * key: "server.qcow2", * file: "myqcow.qcow2", * }); * const snapshot = new scaleway.InstanceSnapshot("snapshot", { * type: "unified", * "import": { * bucket: qcow.bucket, * key: qcow.key, * }, * }); * ``` * * ## Import * * Snapshots can be imported using the `{zone}/{id}`, e.g. bash * * ```sh * $ pulumi import scaleway:index/instanceSnapshot:InstanceSnapshot main fr-par-1/11111111-1111-1111-1111-111111111111 * ``` */ export declare class InstanceSnapshot extends pulumi.CustomResource { /** * Get an existing InstanceSnapshot 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?: InstanceSnapshotState, opts?: pulumi.CustomResourceOptions): InstanceSnapshot; /** * Returns true if the given object is an instance of InstanceSnapshot. 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 InstanceSnapshot; /** * The snapshot creation time. */ readonly createdAt: pulumi.Output<string>; /** * Import a snapshot from a qcow2 file located in a bucket */ readonly import: pulumi.Output<outputs.InstanceSnapshotImport | undefined>; /** * The name of the snapshot. If not provided it will be randomly generated. */ readonly name: pulumi.Output<string>; /** * The organization ID the snapshot is associated with. */ readonly organizationId: pulumi.Output<string>; /** * `projectId`) The ID of the project the snapshot is * associated with. */ readonly projectId: pulumi.Output<string>; /** * (Optional) The size of the snapshot. */ readonly sizeInGb: pulumi.Output<number>; /** * A list of tags to apply to the snapshot. */ readonly tags: pulumi.Output<string[] | undefined>; /** * The snapshot's volume type. The possible values are: `bSsd` (Block SSD), `lSsd` (Local SSD) and `unified`. * Updates to this field will recreate a new resource. */ readonly type: pulumi.Output<string>; /** * The ID of the volume to take a snapshot from. */ readonly volumeId: pulumi.Output<string | undefined>; /** * `zone`) The zone in which * the snapshot should be created. */ readonly zone: pulumi.Output<string>; /** * Create a InstanceSnapshot 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?: InstanceSnapshotArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering InstanceSnapshot resources. */ export interface InstanceSnapshotState { /** * The snapshot creation time. */ createdAt?: pulumi.Input<string>; /** * Import a snapshot from a qcow2 file located in a bucket */ import?: pulumi.Input<inputs.InstanceSnapshotImport>; /** * The name of the snapshot. If not provided it will be randomly generated. */ name?: pulumi.Input<string>; /** * The organization ID the snapshot is associated with. */ organizationId?: pulumi.Input<string>; /** * `projectId`) The ID of the project the snapshot is * associated with. */ projectId?: pulumi.Input<string>; /** * (Optional) The size of the snapshot. */ sizeInGb?: pulumi.Input<number>; /** * A list of tags to apply to the snapshot. */ tags?: pulumi.Input<pulumi.Input<string>[]>; /** * The snapshot's volume type. The possible values are: `bSsd` (Block SSD), `lSsd` (Local SSD) and `unified`. * Updates to this field will recreate a new resource. */ type?: pulumi.Input<string>; /** * The ID of the volume to take a snapshot from. */ volumeId?: pulumi.Input<string>; /** * `zone`) The zone in which * the snapshot should be created. */ zone?: pulumi.Input<string>; } /** * The set of arguments for constructing a InstanceSnapshot resource. */ export interface InstanceSnapshotArgs { /** * Import a snapshot from a qcow2 file located in a bucket */ import?: pulumi.Input<inputs.InstanceSnapshotImport>; /** * The name of the snapshot. If not provided it will be randomly generated. */ name?: pulumi.Input<string>; /** * `projectId`) The ID of the project the snapshot is * associated with. */ projectId?: pulumi.Input<string>; /** * A list of tags to apply to the snapshot. */ tags?: pulumi.Input<pulumi.Input<string>[]>; /** * The snapshot's volume type. The possible values are: `bSsd` (Block SSD), `lSsd` (Local SSD) and `unified`. * Updates to this field will recreate a new resource. */ type?: pulumi.Input<string>; /** * The ID of the volume to take a snapshot from. */ volumeId?: pulumi.Input<string>; /** * `zone`) The zone in which * the snapshot should be created. */ zone?: pulumi.Input<string>; }