Image

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:

Create a Image Resource

new Image(name: string, args?: ImageArgs, opts?: CustomResourceOptions);
def Image(resource_name, opts=None, description=None, disk_size_gb=None, family=None, guest_os_features=None, labels=None, licenses=None, name=None, project=None, raw_disk=None, source_disk=None, __props__=None);
func NewImage(ctx *Context, name string, args *ImageArgs, opts ...ResourceOption) (*Image, error)
public Image(string name, ImageArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ImageArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ImageArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ImageArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Image Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Image resource accepts the following input properties:

Description string

An optional description of this resource. Provide this property when you create the resource.

DiskSizeGb int

Size of the image when restored onto a persistent disk (in GB).

Family 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.

GuestOsFeatures List<ImageGuestOsFeatureArgs>

A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.

Labels Dictionary<string, string>

Labels to apply to this Image.

Licenses List<string>

Any applicable license URI.

Name 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.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

RawDisk ImageRawDiskArgs

The parameters of the raw disk image. Structure is documented below.

SourceDisk string

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.

Description string

An optional description of this resource. Provide this property when you create the resource.

DiskSizeGb int

Size of the image when restored onto a persistent disk (in GB).

Family 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.

GuestOsFeatures []ImageGuestOsFeature

A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.

Labels map[string]string

Labels to apply to this Image.

Licenses []string

Any applicable license URI.

Name 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.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

RawDisk ImageRawDisk

The parameters of the raw disk image. Structure is documented below.

SourceDisk string

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.

description string

An optional description of this resource. Provide this property when you create the resource.

diskSizeGb number

Size of the image when restored onto a persistent disk (in GB).

family 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.

guestOsFeatures ImageGuestOsFeature[]

A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.

labels {[key: string]: string}

Labels to apply to this Image.

licenses string[]

Any applicable license URI.

name 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.

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

rawDisk ImageRawDisk

The parameters of the raw disk image. Structure is documented below.

sourceDisk string

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.

description str

An optional description of this resource. Provide this property when you create the resource.

disk_size_gb float

Size of the image when restored onto a persistent disk (in GB).

family str

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.

guest_os_features List[ImageGuestOsFeature]

A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.

labels Dict[str, str]

Labels to apply to this Image.

licenses List[str]

Any applicable license URI.

name str

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.

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

raw_disk Dict[ImageRawDisk]

The parameters of the raw disk image. Structure is documented below.

source_disk str

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.

Outputs

All input properties are implicitly available as output properties. Additionally, the Image resource produces the following output properties:

ArchiveSizeBytes int

Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).

CreationTimestamp string

Creation timestamp in RFC3339 text format.

Id string
The provider-assigned unique ID for this managed resource.
LabelFingerprint string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

SelfLink string

The URI of the created resource.

ArchiveSizeBytes int

Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).

CreationTimestamp string

Creation timestamp in RFC3339 text format.

Id string
The provider-assigned unique ID for this managed resource.
LabelFingerprint string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

SelfLink string

The URI of the created resource.

archiveSizeBytes number

Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).

creationTimestamp string

Creation timestamp in RFC3339 text format.

id string
The provider-assigned unique ID for this managed resource.
labelFingerprint string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

selfLink string

The URI of the created resource.

archive_size_bytes float

Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).

creation_timestamp str

Creation timestamp in RFC3339 text format.

id str
The provider-assigned unique ID for this managed resource.
label_fingerprint str

The fingerprint used for optimistic locking of this resource. Used internally during updates.

self_link str

The URI of the created resource.

Look up an Existing Image Resource

Get an existing Image resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ImageState, opts?: CustomResourceOptions): Image
static get(resource_name, id, opts=None, archive_size_bytes=None, creation_timestamp=None, description=None, disk_size_gb=None, family=None, guest_os_features=None, label_fingerprint=None, labels=None, licenses=None, name=None, project=None, raw_disk=None, self_link=None, source_disk=None, __props__=None);
func GetImage(ctx *Context, name string, id IDInput, state *ImageState, opts ...ResourceOption) (*Image, error)
public static Image Get(string name, Input<string> id, ImageState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

ArchiveSizeBytes int

Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).

CreationTimestamp string

Creation timestamp in RFC3339 text format.

Description string

An optional description of this resource. Provide this property when you create the resource.

DiskSizeGb int

Size of the image when restored onto a persistent disk (in GB).

Family 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.

GuestOsFeatures List<ImageGuestOsFeatureArgs>

A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.

LabelFingerprint string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

Labels Dictionary<string, string>

Labels to apply to this Image.

Licenses List<string>

Any applicable license URI.

Name 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.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

RawDisk ImageRawDiskArgs

The parameters of the raw disk image. Structure is documented below.

SelfLink string

The URI of the created resource.

SourceDisk string

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.

ArchiveSizeBytes int

Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).

CreationTimestamp string

Creation timestamp in RFC3339 text format.

Description string

An optional description of this resource. Provide this property when you create the resource.

DiskSizeGb int

Size of the image when restored onto a persistent disk (in GB).

Family 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.

GuestOsFeatures []ImageGuestOsFeature

A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.

LabelFingerprint string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

Labels map[string]string

Labels to apply to this Image.

Licenses []string

Any applicable license URI.

Name 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.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

RawDisk ImageRawDisk

The parameters of the raw disk image. Structure is documented below.

SelfLink string

The URI of the created resource.

SourceDisk string

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.

archiveSizeBytes number

Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).

creationTimestamp string

Creation timestamp in RFC3339 text format.

description string

An optional description of this resource. Provide this property when you create the resource.

diskSizeGb number

Size of the image when restored onto a persistent disk (in GB).

family 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.

guestOsFeatures ImageGuestOsFeature[]

A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.

labelFingerprint string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels {[key: string]: string}

Labels to apply to this Image.

licenses string[]

Any applicable license URI.

name 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.

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

rawDisk ImageRawDisk

The parameters of the raw disk image. Structure is documented below.

selfLink string

The URI of the created resource.

sourceDisk string

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.

archive_size_bytes float

Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).

creation_timestamp str

Creation timestamp in RFC3339 text format.

description str

An optional description of this resource. Provide this property when you create the resource.

disk_size_gb float

Size of the image when restored onto a persistent disk (in GB).

family str

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.

guest_os_features List[ImageGuestOsFeature]

A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.

label_fingerprint str

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels Dict[str, str]

Labels to apply to this Image.

licenses List[str]

Any applicable license URI.

name str

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.

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

raw_disk Dict[ImageRawDisk]

The parameters of the raw disk image. Structure is documented below.

self_link str

The URI of the created resource.

source_disk str

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.

Supporting Types

ImageGuestOsFeature

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Type string

The type of supported feature. Read Enabling guest operating system features to see a list of available options.

Type string

The type of supported feature. Read Enabling guest operating system features to see a list of available options.

type string

The type of supported feature. Read Enabling guest operating system features to see a list of available options.

type str

The type of supported feature. Read Enabling guest operating system features to see a list of available options.

ImageRawDisk

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Source string

The full Google Cloud Storage URL where disk storage is stored You must provide either this property or the sourceDisk property but not both.

ContainerType string

The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.

Sha1 string

An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.

Source string

The full Google Cloud Storage URL where disk storage is stored You must provide either this property or the sourceDisk property but not both.

ContainerType string

The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.

Sha1 string

An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.

source string

The full Google Cloud Storage URL where disk storage is stored You must provide either this property or the sourceDisk property but not both.

containerType string

The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.

sha1 string

An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.

source str

The full Google Cloud Storage URL where disk storage is stored You must provide either this property or the sourceDisk property but not both.

containerType str

The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.

sha1 str

An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.