@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
621 lines • 25 kB
TypeScript
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}}
* $ pulumi import gcp:compute/image:Image default {{project}}/{{name}}
* $ 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<pulumi.ID>, 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<number>;
/**
* Creation timestamp in RFC3339 text format.
*/
readonly creationTimestamp: pulumi.Output<string>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
readonly deletionPolicy: pulumi.Output<string>;
/**
* An optional description of this resource. Provide this property when
* you create the resource.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Size of the image when restored onto a persistent disk (in GB).
*/
readonly diskSizeGb: pulumi.Output<number>;
/**
* 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<string | undefined>;
/**
* A list of features to enable on the guest operating system.
* Applicable only for bootable images.
* Structure is documented below.
*/
readonly guestOsFeatures: pulumi.Output<outputs.compute.ImageGuestOsFeature[]>;
/**
* 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<outputs.compute.ImageImageEncryptionKey | undefined>;
/**
* The fingerprint used for optimistic locking of this resource. Used
* internally during updates.
*/
readonly labelFingerprint: pulumi.Output<string>;
/**
* 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<string[]>;
/**
* 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<string>;
/**
* Additional params passed with the request, but not persisted as part of resource payload.
* Structure is documented below.
*/
readonly params: pulumi.Output<outputs.compute.ImageParams | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* 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<outputs.compute.ImageRawDisk | undefined>;
/**
* The URI of the created resource.
*/
readonly selfLink: pulumi.Output<string>;
/**
* Set the secure boot keys of shielded instance.
* Structure is documented below.
*/
readonly shieldedInstanceInitialState: pulumi.Output<outputs.compute.ImageShieldedInstanceInitialState>;
/**
* 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<string | undefined>;
/**
* 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<outputs.compute.ImageSourceDiskEncryptionKey | undefined>;
/**
* 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<string | undefined>;
/**
* 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<outputs.compute.ImageSourceImageEncryptionKey | undefined>;
/**
* 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<string | undefined>;
/**
* 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<outputs.compute.ImageSourceSnapshotEncryptionKey | undefined>;
/**
* 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<string[]>;
/**
* 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<number | undefined>;
/**
* Creation timestamp in RFC3339 text format.
*/
creationTimestamp?: pulumi.Input<string | undefined>;
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* An optional description of this resource. Provide this property when
* you create the resource.
*/
description?: pulumi.Input<string | undefined>;
/**
* Size of the image when restored onto a persistent disk (in GB).
*/
diskSizeGb?: pulumi.Input<number | undefined>;
/**
* 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<string>;
} | undefined>;
/**
* 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<string | undefined>;
/**
* A list of features to enable on the guest operating system.
* Applicable only for bootable images.
* Structure is documented below.
*/
guestOsFeatures?: pulumi.Input<pulumi.Input<inputs.compute.ImageGuestOsFeature>[] | undefined>;
/**
* 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<inputs.compute.ImageImageEncryptionKey | undefined>;
/**
* The fingerprint used for optimistic locking of this resource. Used
* internally during updates.
*/
labelFingerprint?: pulumi.Input<string | undefined>;
/**
* 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<string>;
} | undefined>;
/**
* Any applicable license URI.
*/
licenses?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* 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<string | undefined>;
/**
* Additional params passed with the request, but not persisted as part of resource payload.
* Structure is documented below.
*/
params?: pulumi.Input<inputs.compute.ImageParams | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
/**
* The combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
pulumiLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
} | undefined>;
/**
* The parameters of the raw disk image.
* Structure is documented below.
*/
rawDisk?: pulumi.Input<inputs.compute.ImageRawDisk | undefined>;
/**
* The URI of the created resource.
*/
selfLink?: pulumi.Input<string | undefined>;
/**
* Set the secure boot keys of shielded instance.
* Structure is documented below.
*/
shieldedInstanceInitialState?: pulumi.Input<inputs.compute.ImageShieldedInstanceInitialState | undefined>;
/**
* 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<string | undefined>;
/**
* 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<inputs.compute.ImageSourceDiskEncryptionKey | undefined>;
/**
* 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<string | undefined>;
/**
* 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<inputs.compute.ImageSourceImageEncryptionKey | undefined>;
/**
* 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<string | undefined>;
/**
* 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<inputs.compute.ImageSourceSnapshotEncryptionKey | undefined>;
/**
* 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<pulumi.Input<string>[] | undefined>;
}
/**
* The set of arguments for constructing a Image resource.
*/
export interface ImageArgs {
/**
* Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
* When a 'terraform destroy' or 'pulumi up' would delete the resource,
* the command will fail if this field is set to "PREVENT" in Terraform state.
* When set to "ABANDON", the command will remove the resource from Terraform
* management without updating or deleting the resource in the API.
* When set to "DELETE", deleting the resource is allowed.
*/
deletionPolicy?: pulumi.Input<string | undefined>;
/**
* An optional description of this resource. Provide this property when
* you create the resource.
*/
description?: pulumi.Input<string | undefined>;
/**
* Size of the image when restored onto a persistent disk (in GB).
*/
diskSizeGb?: pulumi.Input<number | undefined>;
/**
* 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<string | undefined>;
/**
* A list of features to enable on the guest operating system.
* Applicable only for bootable images.
* Structure is documented below.
*/
guestOsFeatures?: pulumi.Input<pulumi.Input<inputs.compute.ImageGuestOsFeature>[] | undefined>;
/**
* 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<inputs.compute.ImageImageEncryptionKey | undefined>;
/**
* 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<string>;
} | undefined>;
/**
* Any applicable license URI.
*/
licenses?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* 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<string | undefined>;
/**
* Additional params passed with the request, but not persisted as part of resource payload.
* Structure is documented below.
*/
params?: pulumi.Input<inputs.compute.ImageParams | undefined>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string | undefined>;
/**
* The parameters of the raw disk image.
* Structure is documented below.
*/
rawDisk?: pulumi.Input<inputs.compute.ImageRawDisk | undefined>;
/**
* Set the secure boot keys of shielded instance.
* Structure is documented below.
*/
shieldedInstanceInitialState?: pulumi.Input<inputs.compute.ImageShieldedInstanceInitialState | undefined>;
/**
* 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<string | undefined>;
/**
* 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<inputs.compute.ImageSourceDiskEncryptionKey | undefined>;
/**
* 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<string | undefined>;
/**
* 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<inputs.compute.ImageSourceImageEncryptionKey | undefined>;
/**
* 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<string | undefined>;
/**
* 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<inputs.compute.ImageSourceSnapshotEncryptionKey | undefined>;
/**
* 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<pulumi.Input<string>[] | undefined>;
}
//# sourceMappingURL=image.d.ts.map