import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Represents an Image resource. * * Google Compute Engine uses operating system images to create the root * persistent disks for your instances. You specify an image when you create * an instance. Images contain a boot loader, an operating system, and a * root file system. Linux operating system images are also capable of * running containers on Compute Engine. * * Images can be either public or custom. * * Public images are provided and maintained by Google, open-source * communities, and third-party vendors. By default, all projects have * access to these images and can use them to create instances. Custom * images are available only to your project. You can create a custom image * from root persistent disks and other images. Then, use the custom image * to create an instance. * * To get more information about Image, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/v1/images) * * How-to Guides * * [Official Documentation](https://cloud.google.com/compute/docs/images) * * ## Example Usage * * ### Image Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const debian = gcp.compute.getImage({ * family: "debian-12", * project: "debian-cloud", * }); * const persistent = new gcp.compute.Disk("persistent", { * name: "example-disk", * image: debian.then(debian => debian.selfLink), * size: 10, * type: "pd-ssd", * zone: "us-central1-a", * }); * const example = new gcp.compute.Image("example", { * name: "example-image", * sourceDisk: persistent.id, * }); * ``` * ### Image Guest Os * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const debian = gcp.compute.getImage({ * family: "debian-12", * project: "debian-cloud", * }); * const persistent = new gcp.compute.Disk("persistent", { * name: "example-disk", * image: debian.then(debian => debian.selfLink), * size: 10, * type: "pd-ssd", * zone: "us-central1-a", * }); * const example = new gcp.compute.Image("example", { * name: "example-image", * sourceDisk: persistent.id, * guestOsFeatures: [ * { * type: "UEFI_COMPATIBLE", * }, * { * type: "VIRTIO_SCSI_MULTIQUEUE", * }, * { * type: "GVNIC", * }, * { * type: "SEV_CAPABLE", * }, * { * type: "SEV_LIVE_MIGRATABLE_V2", * }, * ], * }); * ``` * ### Image Basic Storage Location * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const debian = gcp.compute.getImage({ * family: "debian-12", * project: "debian-cloud", * }); * const persistent = new gcp.compute.Disk("persistent", { * name: "example-disk", * image: debian.then(debian => debian.selfLink), * size: 10, * type: "pd-ssd", * zone: "us-central1-a", * }); * const example = new gcp.compute.Image("example", { * name: "example-sl-image", * sourceDisk: persistent.id, * storageLocations: ["us-central1"], * }); * ``` * * ## Import * * Image can be imported using any of these accepted formats: * * * `projects/{{project}}/global/images/{{name}}` * * * `{{project}}/{{name}}` * * * `{{name}}` * * When using the `pulumi import` command, Image can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/image:Image default projects/{{project}}/global/images/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/image:Image default {{project}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/image:Image default {{name}} * ``` */ export declare class Image extends pulumi.CustomResource { /** * Get an existing Image 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?: ImageState, opts?: pulumi.CustomResourceOptions): Image; /** * Returns true if the given object is an instance of Image. 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 Image; /** * Size of the image tar.gz archive stored in Google Cloud Storage (in * bytes). */ readonly archiveSizeBytes: pulumi.Output; /** * Creation timestamp in RFC3339 text format. */ readonly creationTimestamp: pulumi.Output; /** * An optional description of this resource. Provide this property when * you create the resource. */ readonly description: pulumi.Output; /** * Size of the image when restored onto a persistent disk (in GB). */ readonly diskSizeGb: pulumi.Output; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ readonly effectiveLabels: pulumi.Output<{ [key: string]: string; }>; /** * The name of the image family to which this image belongs. You can * create disks by specifying an image family instead of a specific * image name. The image family always returns its latest image that is * not deprecated. The name of the image family must comply with * RFC1035. */ readonly family: pulumi.Output; /** * A list of features to enable on the guest operating system. * Applicable only for bootable images. * Structure is documented below. */ readonly guestOsFeatures: pulumi.Output; /** * Encrypts the image using a customer-supplied encryption key. * After you encrypt an image with a customer-supplied key, you must * provide the same key if you use the image later (e.g. to create a * disk from the image) * Structure is documented below. */ readonly imageEncryptionKey: pulumi.Output; /** * The fingerprint used for optimistic locking of this resource. Used * internally during updates. */ readonly labelFingerprint: pulumi.Output; /** * Labels to apply to this Image. * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Any applicable license URI. */ readonly licenses: pulumi.Output; /** * Name of the resource; provided by the client when the resource is * created. The name must be 1-63 characters long, and comply with * RFC1035. Specifically, the name must be 1-63 characters long and * match the regular expression `a-z?` which means * the first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the * last character, which cannot be a dash. */ readonly name: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * The parameters of the raw disk image. * Structure is documented below. */ readonly rawDisk: pulumi.Output; /** * The URI of the created resource. */ readonly selfLink: pulumi.Output; /** * Set the secure boot keys of shielded instance. * Structure is documented below. */ readonly shieldedInstanceInitialState: pulumi.Output; /** * The source disk to create this image based on. * You must provide either this property or the * rawDisk.source property but not both to create an image. */ readonly sourceDisk: pulumi.Output; /** * The customer-supplied encryption key of the source disk. Required if * the source disk is protected by a customer-supplied encryption key. * Structure is documented below. */ readonly sourceDiskEncryptionKey: pulumi.Output; /** * URL of the source image used to create this image. In order to create an image, you must provide the full or partial * URL of one of the following: * * The selfLink URL * * This property * * The rawDisk.source URL * * The sourceDisk URL */ readonly sourceImage: pulumi.Output; /** * The customer-supplied encryption key of the source image. Required if * the source image is protected by a customer-supplied encryption key. * Structure is documented below. */ readonly sourceImageEncryptionKey: pulumi.Output; /** * URL of the source snapshot used to create this image. * In order to create an image, you must provide the full or partial URL of one of the following: * * The selfLink URL * * This property * * The sourceImage URL * * The rawDisk.source URL * * The sourceDisk URL */ readonly sourceSnapshot: pulumi.Output; /** * The customer-supplied encryption key of the source snapshot. Required if * the source snapshot is protected by a customer-supplied encryption key. * Structure is documented below. */ readonly sourceSnapshotEncryptionKey: pulumi.Output; /** * Cloud Storage bucket storage location of the image * (regional or multi-regional). * Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images */ readonly storageLocations: pulumi.Output; /** * Create a Image 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?: ImageArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Image resources. */ export interface ImageState { /** * Size of the image tar.gz archive stored in Google Cloud Storage (in * bytes). */ archiveSizeBytes?: pulumi.Input; /** * Creation timestamp in RFC3339 text format. */ creationTimestamp?: pulumi.Input; /** * An optional description of this resource. Provide this property when * you create the resource. */ description?: pulumi.Input; /** * Size of the image when restored onto a persistent disk (in GB). */ diskSizeGb?: pulumi.Input; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ effectiveLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The name of the image family to which this image belongs. You can * create disks by specifying an image family instead of a specific * image name. The image family always returns its latest image that is * not deprecated. The name of the image family must comply with * RFC1035. */ family?: pulumi.Input; /** * A list of features to enable on the guest operating system. * Applicable only for bootable images. * Structure is documented below. */ guestOsFeatures?: pulumi.Input[]>; /** * Encrypts the image using a customer-supplied encryption key. * After you encrypt an image with a customer-supplied key, you must * provide the same key if you use the image later (e.g. to create a * disk from the image) * Structure is documented below. */ imageEncryptionKey?: pulumi.Input; /** * The fingerprint used for optimistic locking of this resource. Used * internally during updates. */ labelFingerprint?: pulumi.Input; /** * Labels to apply to this Image. * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Any applicable license URI. */ licenses?: pulumi.Input[]>; /** * Name of the resource; provided by the client when the resource is * created. The name must be 1-63 characters long, and comply with * RFC1035. Specifically, the name must be 1-63 characters long and * match the regular expression `a-z?` which means * the first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the * last character, which cannot be a dash. */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The parameters of the raw disk image. * Structure is documented below. */ rawDisk?: pulumi.Input; /** * The URI of the created resource. */ selfLink?: pulumi.Input; /** * Set the secure boot keys of shielded instance. * Structure is documented below. */ shieldedInstanceInitialState?: pulumi.Input; /** * The source disk to create this image based on. * You must provide either this property or the * rawDisk.source property but not both to create an image. */ sourceDisk?: pulumi.Input; /** * The customer-supplied encryption key of the source disk. Required if * the source disk is protected by a customer-supplied encryption key. * Structure is documented below. */ sourceDiskEncryptionKey?: pulumi.Input; /** * URL of the source image used to create this image. In order to create an image, you must provide the full or partial * URL of one of the following: * * The selfLink URL * * This property * * The rawDisk.source URL * * The sourceDisk URL */ sourceImage?: pulumi.Input; /** * The customer-supplied encryption key of the source image. Required if * the source image is protected by a customer-supplied encryption key. * Structure is documented below. */ sourceImageEncryptionKey?: pulumi.Input; /** * URL of the source snapshot used to create this image. * In order to create an image, you must provide the full or partial URL of one of the following: * * The selfLink URL * * This property * * The sourceImage URL * * The rawDisk.source URL * * The sourceDisk URL */ sourceSnapshot?: pulumi.Input; /** * The customer-supplied encryption key of the source snapshot. Required if * the source snapshot is protected by a customer-supplied encryption key. * Structure is documented below. */ sourceSnapshotEncryptionKey?: pulumi.Input; /** * Cloud Storage bucket storage location of the image * (regional or multi-regional). * Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images */ storageLocations?: pulumi.Input[]>; } /** * The set of arguments for constructing a Image resource. */ export interface ImageArgs { /** * An optional description of this resource. Provide this property when * you create the resource. */ description?: pulumi.Input; /** * Size of the image when restored onto a persistent disk (in GB). */ diskSizeGb?: pulumi.Input; /** * The name of the image family to which this image belongs. You can * create disks by specifying an image family instead of a specific * image name. The image family always returns its latest image that is * not deprecated. The name of the image family must comply with * RFC1035. */ family?: pulumi.Input; /** * A list of features to enable on the guest operating system. * Applicable only for bootable images. * Structure is documented below. */ guestOsFeatures?: pulumi.Input[]>; /** * Encrypts the image using a customer-supplied encryption key. * After you encrypt an image with a customer-supplied key, you must * provide the same key if you use the image later (e.g. to create a * disk from the image) * Structure is documented below. */ imageEncryptionKey?: pulumi.Input; /** * Labels to apply to this Image. * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Any applicable license URI. */ licenses?: pulumi.Input[]>; /** * Name of the resource; provided by the client when the resource is * created. The name must be 1-63 characters long, and comply with * RFC1035. Specifically, the name must be 1-63 characters long and * match the regular expression `a-z?` which means * the first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the * last character, which cannot be a dash. */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The parameters of the raw disk image. * Structure is documented below. */ rawDisk?: pulumi.Input; /** * Set the secure boot keys of shielded instance. * Structure is documented below. */ shieldedInstanceInitialState?: pulumi.Input; /** * The source disk to create this image based on. * You must provide either this property or the * rawDisk.source property but not both to create an image. */ sourceDisk?: pulumi.Input; /** * The customer-supplied encryption key of the source disk. Required if * the source disk is protected by a customer-supplied encryption key. * Structure is documented below. */ sourceDiskEncryptionKey?: pulumi.Input; /** * URL of the source image used to create this image. In order to create an image, you must provide the full or partial * URL of one of the following: * * The selfLink URL * * This property * * The rawDisk.source URL * * The sourceDisk URL */ sourceImage?: pulumi.Input; /** * The customer-supplied encryption key of the source image. Required if * the source image is protected by a customer-supplied encryption key. * Structure is documented below. */ sourceImageEncryptionKey?: pulumi.Input; /** * URL of the source snapshot used to create this image. * In order to create an image, you must provide the full or partial URL of one of the following: * * The selfLink URL * * This property * * The sourceImage URL * * The rawDisk.source URL * * The sourceDisk URL */ sourceSnapshot?: pulumi.Input; /** * The customer-supplied encryption key of the source snapshot. Required if * the source snapshot is protected by a customer-supplied encryption key. * Structure is documented below. */ sourceSnapshotEncryptionKey?: pulumi.Input; /** * Cloud Storage bucket storage location of the image * (regional or multi-regional). * Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images */ storageLocations?: pulumi.Input[]>; }