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:
- API documentation
- How-to Guides
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);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.
- Disk
Size intGb 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.
- Guest
Os List<ImageFeatures Guest Os Feature Args> 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.
- Raw
Disk ImageRaw Disk Args The parameters of the raw disk image. Structure is documented below.
- Source
Disk 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.
- Disk
Size intGb 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.
- Guest
Os []ImageFeatures Guest Os Feature 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.
- Raw
Disk ImageRaw Disk The parameters of the raw disk image. Structure is documented below.
- Source
Disk 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.
- disk
Size numberGb 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.
- guest
Os ImageFeatures Guest Os Feature[] 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.
- raw
Disk ImageRaw Disk The parameters of the raw disk image. Structure is documented below.
- source
Disk 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_ floatgb 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_ List[Imagefeatures Guest Os Feature] 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[ImageRaw Disk] 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:
- Archive
Size intBytes Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Label
Fingerprint string The fingerprint used for optimistic locking of this resource. Used internally during updates.
- Self
Link string The URI of the created resource.
- Archive
Size intBytes Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Label
Fingerprint string The fingerprint used for optimistic locking of this resource. Used internally during updates.
- Self
Link string The URI of the created resource.
- archive
Size numberBytes Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
- creation
Timestamp string Creation timestamp in RFC3339 text format.
- id string
- The provider-assigned unique ID for this managed resource.
- label
Fingerprint string The fingerprint used for optimistic locking of this resource. Used internally during updates.
- self
Link string The URI of the created resource.
- archive_
size_ floatbytes 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): Imagestatic 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:
- Archive
Size intBytes Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Description string
An optional description of this resource. Provide this property when you create the resource.
- Disk
Size intGb 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.
- Guest
Os List<ImageFeatures Guest Os Feature Args> A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
- Label
Fingerprint 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.
- Raw
Disk ImageRaw Disk Args The parameters of the raw disk image. Structure is documented below.
- Self
Link string The URI of the created resource.
- Source
Disk 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 intBytes Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Description string
An optional description of this resource. Provide this property when you create the resource.
- Disk
Size intGb 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.
- Guest
Os []ImageFeatures Guest Os Feature A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
- Label
Fingerprint 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.
- Raw
Disk ImageRaw Disk The parameters of the raw disk image. Structure is documented below.
- Self
Link string The URI of the created resource.
- Source
Disk 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 numberBytes Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
- creation
Timestamp string Creation timestamp in RFC3339 text format.
- description string
An optional description of this resource. Provide this property when you create the resource.
- disk
Size numberGb 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.
- guest
Os ImageFeatures Guest Os Feature[] A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
- label
Fingerprint 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.
- raw
Disk ImageRaw Disk The parameters of the raw disk image. Structure is documented below.
- self
Link string The URI of the created resource.
- source
Disk 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_ floatbytes 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_ floatgb 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_ List[Imagefeatures Guest Os Feature] 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[ImageRaw Disk] 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
- 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
- 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.
- Container
Type 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.
- Container
Type 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.
- container
Type 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.
- container
Type 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-betaTerraform Provider.