1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. Image
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

gcp.compute.Image

Explore with Pulumi AI

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:

Example Usage

Image Basic

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,
});
Copy
import pulumi
import pulumi_gcp as gcp

debian = gcp.compute.get_image(family="debian-12",
    project="debian-cloud")
persistent = gcp.compute.Disk("persistent",
    name="example-disk",
    image=debian.self_link,
    size=10,
    type="pd-ssd",
    zone="us-central1-a")
example = gcp.compute.Image("example",
    name="example-image",
    source_disk=persistent.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		debian, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
			Family:  pulumi.StringRef("debian-12"),
			Project: pulumi.StringRef("debian-cloud"),
		}, nil)
		if err != nil {
			return err
		}
		persistent, err := compute.NewDisk(ctx, "persistent", &compute.DiskArgs{
			Name:  pulumi.String("example-disk"),
			Image: pulumi.String(debian.SelfLink),
			Size:  pulumi.Int(10),
			Type:  pulumi.String("pd-ssd"),
			Zone:  pulumi.String("us-central1-a"),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewImage(ctx, "example", &compute.ImageArgs{
			Name:       pulumi.String("example-image"),
			SourceDisk: persistent.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var debian = Gcp.Compute.GetImage.Invoke(new()
    {
        Family = "debian-12",
        Project = "debian-cloud",
    });

    var persistent = new Gcp.Compute.Disk("persistent", new()
    {
        Name = "example-disk",
        Image = debian.Apply(getImageResult => getImageResult.SelfLink),
        Size = 10,
        Type = "pd-ssd",
        Zone = "us-central1-a",
    });

    var example = new Gcp.Compute.Image("example", new()
    {
        Name = "example-image",
        SourceDisk = persistent.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetImageArgs;
import com.pulumi.gcp.compute.Disk;
import com.pulumi.gcp.compute.DiskArgs;
import com.pulumi.gcp.compute.Image;
import com.pulumi.gcp.compute.ImageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var debian = ComputeFunctions.getImage(GetImageArgs.builder()
            .family("debian-12")
            .project("debian-cloud")
            .build());

        var persistent = new Disk("persistent", DiskArgs.builder()
            .name("example-disk")
            .image(debian.applyValue(getImageResult -> getImageResult.selfLink()))
            .size(10)
            .type("pd-ssd")
            .zone("us-central1-a")
            .build());

        var example = new Image("example", ImageArgs.builder()
            .name("example-image")
            .sourceDisk(persistent.id())
            .build());

    }
}
Copy
resources:
  persistent:
    type: gcp:compute:Disk
    properties:
      name: example-disk
      image: ${debian.selfLink}
      size: 10
      type: pd-ssd
      zone: us-central1-a
  example:
    type: gcp:compute:Image
    properties:
      name: example-image
      sourceDisk: ${persistent.id}
variables:
  debian:
    fn::invoke:
      function: gcp:compute:getImage
      arguments:
        family: debian-12
        project: debian-cloud
Copy

Image Guest Os

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",
        },
    ],
});
Copy
import pulumi
import pulumi_gcp as gcp

debian = gcp.compute.get_image(family="debian-12",
    project="debian-cloud")
persistent = gcp.compute.Disk("persistent",
    name="example-disk",
    image=debian.self_link,
    size=10,
    type="pd-ssd",
    zone="us-central1-a")
example = gcp.compute.Image("example",
    name="example-image",
    source_disk=persistent.id,
    guest_os_features=[
        {
            "type": "UEFI_COMPATIBLE",
        },
        {
            "type": "VIRTIO_SCSI_MULTIQUEUE",
        },
        {
            "type": "GVNIC",
        },
        {
            "type": "SEV_CAPABLE",
        },
        {
            "type": "SEV_LIVE_MIGRATABLE_V2",
        },
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		debian, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
			Family:  pulumi.StringRef("debian-12"),
			Project: pulumi.StringRef("debian-cloud"),
		}, nil)
		if err != nil {
			return err
		}
		persistent, err := compute.NewDisk(ctx, "persistent", &compute.DiskArgs{
			Name:  pulumi.String("example-disk"),
			Image: pulumi.String(debian.SelfLink),
			Size:  pulumi.Int(10),
			Type:  pulumi.String("pd-ssd"),
			Zone:  pulumi.String("us-central1-a"),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewImage(ctx, "example", &compute.ImageArgs{
			Name:       pulumi.String("example-image"),
			SourceDisk: persistent.ID(),
			GuestOsFeatures: compute.ImageGuestOsFeatureArray{
				&compute.ImageGuestOsFeatureArgs{
					Type: pulumi.String("UEFI_COMPATIBLE"),
				},
				&compute.ImageGuestOsFeatureArgs{
					Type: pulumi.String("VIRTIO_SCSI_MULTIQUEUE"),
				},
				&compute.ImageGuestOsFeatureArgs{
					Type: pulumi.String("GVNIC"),
				},
				&compute.ImageGuestOsFeatureArgs{
					Type: pulumi.String("SEV_CAPABLE"),
				},
				&compute.ImageGuestOsFeatureArgs{
					Type: pulumi.String("SEV_LIVE_MIGRATABLE_V2"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var debian = Gcp.Compute.GetImage.Invoke(new()
    {
        Family = "debian-12",
        Project = "debian-cloud",
    });

    var persistent = new Gcp.Compute.Disk("persistent", new()
    {
        Name = "example-disk",
        Image = debian.Apply(getImageResult => getImageResult.SelfLink),
        Size = 10,
        Type = "pd-ssd",
        Zone = "us-central1-a",
    });

    var example = new Gcp.Compute.Image("example", new()
    {
        Name = "example-image",
        SourceDisk = persistent.Id,
        GuestOsFeatures = new[]
        {
            new Gcp.Compute.Inputs.ImageGuestOsFeatureArgs
            {
                Type = "UEFI_COMPATIBLE",
            },
            new Gcp.Compute.Inputs.ImageGuestOsFeatureArgs
            {
                Type = "VIRTIO_SCSI_MULTIQUEUE",
            },
            new Gcp.Compute.Inputs.ImageGuestOsFeatureArgs
            {
                Type = "GVNIC",
            },
            new Gcp.Compute.Inputs.ImageGuestOsFeatureArgs
            {
                Type = "SEV_CAPABLE",
            },
            new Gcp.Compute.Inputs.ImageGuestOsFeatureArgs
            {
                Type = "SEV_LIVE_MIGRATABLE_V2",
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetImageArgs;
import com.pulumi.gcp.compute.Disk;
import com.pulumi.gcp.compute.DiskArgs;
import com.pulumi.gcp.compute.Image;
import com.pulumi.gcp.compute.ImageArgs;
import com.pulumi.gcp.compute.inputs.ImageGuestOsFeatureArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var debian = ComputeFunctions.getImage(GetImageArgs.builder()
            .family("debian-12")
            .project("debian-cloud")
            .build());

        var persistent = new Disk("persistent", DiskArgs.builder()
            .name("example-disk")
            .image(debian.applyValue(getImageResult -> getImageResult.selfLink()))
            .size(10)
            .type("pd-ssd")
            .zone("us-central1-a")
            .build());

        var example = new Image("example", ImageArgs.builder()
            .name("example-image")
            .sourceDisk(persistent.id())
            .guestOsFeatures(            
                ImageGuestOsFeatureArgs.builder()
                    .type("UEFI_COMPATIBLE")
                    .build(),
                ImageGuestOsFeatureArgs.builder()
                    .type("VIRTIO_SCSI_MULTIQUEUE")
                    .build(),
                ImageGuestOsFeatureArgs.builder()
                    .type("GVNIC")
                    .build(),
                ImageGuestOsFeatureArgs.builder()
                    .type("SEV_CAPABLE")
                    .build(),
                ImageGuestOsFeatureArgs.builder()
                    .type("SEV_LIVE_MIGRATABLE_V2")
                    .build())
            .build());

    }
}
Copy
resources:
  persistent:
    type: gcp:compute:Disk
    properties:
      name: example-disk
      image: ${debian.selfLink}
      size: 10
      type: pd-ssd
      zone: us-central1-a
  example:
    type: gcp:compute:Image
    properties:
      name: example-image
      sourceDisk: ${persistent.id}
      guestOsFeatures:
        - type: UEFI_COMPATIBLE
        - type: VIRTIO_SCSI_MULTIQUEUE
        - type: GVNIC
        - type: SEV_CAPABLE
        - type: SEV_LIVE_MIGRATABLE_V2
variables:
  debian:
    fn::invoke:
      function: gcp:compute:getImage
      arguments:
        family: debian-12
        project: debian-cloud
Copy

Image Basic Storage Location

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"],
});
Copy
import pulumi
import pulumi_gcp as gcp

debian = gcp.compute.get_image(family="debian-12",
    project="debian-cloud")
persistent = gcp.compute.Disk("persistent",
    name="example-disk",
    image=debian.self_link,
    size=10,
    type="pd-ssd",
    zone="us-central1-a")
example = gcp.compute.Image("example",
    name="example-sl-image",
    source_disk=persistent.id,
    storage_locations=["us-central1"])
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		debian, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
			Family:  pulumi.StringRef("debian-12"),
			Project: pulumi.StringRef("debian-cloud"),
		}, nil)
		if err != nil {
			return err
		}
		persistent, err := compute.NewDisk(ctx, "persistent", &compute.DiskArgs{
			Name:  pulumi.String("example-disk"),
			Image: pulumi.String(debian.SelfLink),
			Size:  pulumi.Int(10),
			Type:  pulumi.String("pd-ssd"),
			Zone:  pulumi.String("us-central1-a"),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewImage(ctx, "example", &compute.ImageArgs{
			Name:       pulumi.String("example-sl-image"),
			SourceDisk: persistent.ID(),
			StorageLocations: pulumi.StringArray{
				pulumi.String("us-central1"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var debian = Gcp.Compute.GetImage.Invoke(new()
    {
        Family = "debian-12",
        Project = "debian-cloud",
    });

    var persistent = new Gcp.Compute.Disk("persistent", new()
    {
        Name = "example-disk",
        Image = debian.Apply(getImageResult => getImageResult.SelfLink),
        Size = 10,
        Type = "pd-ssd",
        Zone = "us-central1-a",
    });

    var example = new Gcp.Compute.Image("example", new()
    {
        Name = "example-sl-image",
        SourceDisk = persistent.Id,
        StorageLocations = new[]
        {
            "us-central1",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetImageArgs;
import com.pulumi.gcp.compute.Disk;
import com.pulumi.gcp.compute.DiskArgs;
import com.pulumi.gcp.compute.Image;
import com.pulumi.gcp.compute.ImageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var debian = ComputeFunctions.getImage(GetImageArgs.builder()
            .family("debian-12")
            .project("debian-cloud")
            .build());

        var persistent = new Disk("persistent", DiskArgs.builder()
            .name("example-disk")
            .image(debian.applyValue(getImageResult -> getImageResult.selfLink()))
            .size(10)
            .type("pd-ssd")
            .zone("us-central1-a")
            .build());

        var example = new Image("example", ImageArgs.builder()
            .name("example-sl-image")
            .sourceDisk(persistent.id())
            .storageLocations("us-central1")
            .build());

    }
}
Copy
resources:
  persistent:
    type: gcp:compute:Disk
    properties:
      name: example-disk
      image: ${debian.selfLink}
      size: 10
      type: pd-ssd
      zone: us-central1-a
  example:
    type: gcp:compute:Image
    properties:
      name: example-sl-image
      sourceDisk: ${persistent.id}
      storageLocations:
        - us-central1
variables:
  debian:
    fn::invoke:
      function: gcp:compute:getImage
      arguments:
        family: debian-12
        project: debian-cloud
Copy

Create Image Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Image(name: string, args?: ImageArgs, opts?: CustomResourceOptions);
@overload
def Image(resource_name: str,
          args: Optional[ImageArgs] = None,
          opts: Optional[ResourceOptions] = None)

@overload
def Image(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          description: Optional[str] = None,
          disk_size_gb: Optional[int] = None,
          family: Optional[str] = None,
          guest_os_features: Optional[Sequence[ImageGuestOsFeatureArgs]] = None,
          image_encryption_key: Optional[ImageImageEncryptionKeyArgs] = None,
          labels: Optional[Mapping[str, str]] = None,
          licenses: Optional[Sequence[str]] = None,
          name: Optional[str] = None,
          project: Optional[str] = None,
          raw_disk: Optional[ImageRawDiskArgs] = None,
          source_disk: Optional[str] = None,
          source_image: Optional[str] = None,
          source_snapshot: Optional[str] = None,
          storage_locations: Optional[Sequence[str]] = None)
func NewImage(ctx *Context, name string, args *ImageArgs, opts ...ResourceOption) (*Image, error)
public Image(string name, ImageArgs? args = null, CustomResourceOptions? opts = null)
public Image(String name, ImageArgs args)
public Image(String name, ImageArgs args, CustomResourceOptions options)
type: gcp:compute:Image
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. 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 This property is required. str
The unique name of the resource.
args ImageArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. 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 This property is required. string
The unique name of the resource.
args ImageArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ImageArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var imageResource = new Gcp.Compute.Image("imageResource", new()
{
    Description = "string",
    DiskSizeGb = 0,
    Family = "string",
    GuestOsFeatures = new[]
    {
        new Gcp.Compute.Inputs.ImageGuestOsFeatureArgs
        {
            Type = "string",
        },
    },
    ImageEncryptionKey = new Gcp.Compute.Inputs.ImageImageEncryptionKeyArgs
    {
        KmsKeySelfLink = "string",
        KmsKeyServiceAccount = "string",
    },
    Labels = 
    {
        { "string", "string" },
    },
    Licenses = new[]
    {
        "string",
    },
    Name = "string",
    Project = "string",
    RawDisk = new Gcp.Compute.Inputs.ImageRawDiskArgs
    {
        Source = "string",
        ContainerType = "string",
        Sha1 = "string",
    },
    SourceDisk = "string",
    SourceImage = "string",
    SourceSnapshot = "string",
    StorageLocations = new[]
    {
        "string",
    },
});
Copy
example, err := compute.NewImage(ctx, "imageResource", &compute.ImageArgs{
	Description: pulumi.String("string"),
	DiskSizeGb:  pulumi.Int(0),
	Family:      pulumi.String("string"),
	GuestOsFeatures: compute.ImageGuestOsFeatureArray{
		&compute.ImageGuestOsFeatureArgs{
			Type: pulumi.String("string"),
		},
	},
	ImageEncryptionKey: &compute.ImageImageEncryptionKeyArgs{
		KmsKeySelfLink:       pulumi.String("string"),
		KmsKeyServiceAccount: pulumi.String("string"),
	},
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Licenses: pulumi.StringArray{
		pulumi.String("string"),
	},
	Name:    pulumi.String("string"),
	Project: pulumi.String("string"),
	RawDisk: &compute.ImageRawDiskArgs{
		Source:        pulumi.String("string"),
		ContainerType: pulumi.String("string"),
		Sha1:          pulumi.String("string"),
	},
	SourceDisk:     pulumi.String("string"),
	SourceImage:    pulumi.String("string"),
	SourceSnapshot: pulumi.String("string"),
	StorageLocations: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var imageResource = new Image("imageResource", ImageArgs.builder()
    .description("string")
    .diskSizeGb(0)
    .family("string")
    .guestOsFeatures(ImageGuestOsFeatureArgs.builder()
        .type("string")
        .build())
    .imageEncryptionKey(ImageImageEncryptionKeyArgs.builder()
        .kmsKeySelfLink("string")
        .kmsKeyServiceAccount("string")
        .build())
    .labels(Map.of("string", "string"))
    .licenses("string")
    .name("string")
    .project("string")
    .rawDisk(ImageRawDiskArgs.builder()
        .source("string")
        .containerType("string")
        .sha1("string")
        .build())
    .sourceDisk("string")
    .sourceImage("string")
    .sourceSnapshot("string")
    .storageLocations("string")
    .build());
Copy
image_resource = gcp.compute.Image("imageResource",
    description="string",
    disk_size_gb=0,
    family="string",
    guest_os_features=[{
        "type": "string",
    }],
    image_encryption_key={
        "kms_key_self_link": "string",
        "kms_key_service_account": "string",
    },
    labels={
        "string": "string",
    },
    licenses=["string"],
    name="string",
    project="string",
    raw_disk={
        "source": "string",
        "container_type": "string",
        "sha1": "string",
    },
    source_disk="string",
    source_image="string",
    source_snapshot="string",
    storage_locations=["string"])
Copy
const imageResource = new gcp.compute.Image("imageResource", {
    description: "string",
    diskSizeGb: 0,
    family: "string",
    guestOsFeatures: [{
        type: "string",
    }],
    imageEncryptionKey: {
        kmsKeySelfLink: "string",
        kmsKeyServiceAccount: "string",
    },
    labels: {
        string: "string",
    },
    licenses: ["string"],
    name: "string",
    project: "string",
    rawDisk: {
        source: "string",
        containerType: "string",
        sha1: "string",
    },
    sourceDisk: "string",
    sourceImage: "string",
    sourceSnapshot: "string",
    storageLocations: ["string"],
});
Copy
type: gcp:compute:Image
properties:
    description: string
    diskSizeGb: 0
    family: string
    guestOsFeatures:
        - type: string
    imageEncryptionKey:
        kmsKeySelfLink: string
        kmsKeyServiceAccount: string
    labels:
        string: string
    licenses:
        - string
    name: string
    project: string
    rawDisk:
        containerType: string
        sha1: string
        source: string
    sourceDisk: string
    sourceImage: string
    sourceSnapshot: string
    storageLocations:
        - string
Copy

Image Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Image resource accepts the following input properties:

Description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
DiskSizeGb Changes to this property will trigger replacement. int
Size of the image when restored onto a persistent disk (in GB).
Family Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<ImageGuestOsFeature>
A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
ImageEncryptionKey Changes to this property will trigger replacement. ImageImageEncryptionKey
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.
Labels Dictionary<string, 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 effective_labels for all of the labels present on the resource.
Licenses Changes to this property will trigger replacement. List<string>
Any applicable license URI.
Name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
RawDisk Changes to this property will trigger replacement. ImageRawDisk
The parameters of the raw disk image. Structure is documented below.
SourceDisk Changes to this property will trigger replacement. 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.
SourceImage Changes to this property will trigger replacement. string
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
SourceSnapshot Changes to this property will trigger replacement. string
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
StorageLocations Changes to this property will trigger replacement. List<string>
Cloud Storage bucket storage location of the image (regional or multi-regional). Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images
Description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
DiskSizeGb Changes to this property will trigger replacement. int
Size of the image when restored onto a persistent disk (in GB).
Family Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. []ImageGuestOsFeatureArgs
A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
ImageEncryptionKey Changes to this property will trigger replacement. ImageImageEncryptionKeyArgs
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.
Labels map[string]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 effective_labels for all of the labels present on the resource.
Licenses Changes to this property will trigger replacement. []string
Any applicable license URI.
Name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
RawDisk Changes to this property will trigger replacement. ImageRawDiskArgs
The parameters of the raw disk image. Structure is documented below.
SourceDisk Changes to this property will trigger replacement. 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.
SourceImage Changes to this property will trigger replacement. string
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
SourceSnapshot Changes to this property will trigger replacement. string
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
StorageLocations Changes to this property will trigger replacement. []string
Cloud Storage bucket storage location of the image (regional or multi-regional). Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images
description Changes to this property will trigger replacement. String
An optional description of this resource. Provide this property when you create the resource.
diskSizeGb Changes to this property will trigger replacement. Integer
Size of the image when restored onto a persistent disk (in GB).
family Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<ImageGuestOsFeature>
A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
imageEncryptionKey Changes to this property will trigger replacement. ImageImageEncryptionKey
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.
labels Map<String,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 effective_labels for all of the labels present on the resource.
licenses Changes to this property will trigger replacement. List<String>
Any applicable license URI.
name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
rawDisk Changes to this property will trigger replacement. ImageRawDisk
The parameters of the raw disk image. Structure is documented below.
sourceDisk Changes to this property will trigger replacement. 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.
sourceImage Changes to this property will trigger replacement. String
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
sourceSnapshot Changes to this property will trigger replacement. String
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
storageLocations Changes to this property will trigger replacement. List<String>
Cloud Storage bucket storage location of the image (regional or multi-regional). Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images
description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
diskSizeGb Changes to this property will trigger replacement. number
Size of the image when restored onto a persistent disk (in GB).
family Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. ImageGuestOsFeature[]
A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
imageEncryptionKey Changes to this property will trigger replacement. ImageImageEncryptionKey
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.
labels {[key: string]: 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 effective_labels for all of the labels present on the resource.
licenses Changes to this property will trigger replacement. string[]
Any applicable license URI.
name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
rawDisk Changes to this property will trigger replacement. ImageRawDisk
The parameters of the raw disk image. Structure is documented below.
sourceDisk Changes to this property will trigger replacement. 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.
sourceImage Changes to this property will trigger replacement. string
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
sourceSnapshot Changes to this property will trigger replacement. string
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
storageLocations Changes to this property will trigger replacement. string[]
Cloud Storage bucket storage location of the image (regional or multi-regional). Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images
description Changes to this property will trigger replacement. str
An optional description of this resource. Provide this property when you create the resource.
disk_size_gb Changes to this property will trigger replacement. int
Size of the image when restored onto a persistent disk (in GB).
family Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Sequence[ImageGuestOsFeatureArgs]
A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
image_encryption_key Changes to this property will trigger replacement. ImageImageEncryptionKeyArgs
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.
labels Mapping[str, str]
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 effective_labels for all of the labels present on the resource.
licenses Changes to this property will trigger replacement. Sequence[str]
Any applicable license URI.
name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
raw_disk Changes to this property will trigger replacement. ImageRawDiskArgs
The parameters of the raw disk image. Structure is documented below.
source_disk Changes to this property will trigger replacement. 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.
source_image Changes to this property will trigger replacement. str
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
source_snapshot Changes to this property will trigger replacement. str
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
storage_locations Changes to this property will trigger replacement. Sequence[str]
Cloud Storage bucket storage location of the image (regional or multi-regional). Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images
description Changes to this property will trigger replacement. String
An optional description of this resource. Provide this property when you create the resource.
diskSizeGb Changes to this property will trigger replacement. Number
Size of the image when restored onto a persistent disk (in GB).
family Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<Property Map>
A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
imageEncryptionKey Changes to this property will trigger replacement. Property Map
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.
labels Map<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 effective_labels for all of the labels present on the resource.
licenses Changes to this property will trigger replacement. List<String>
Any applicable license URI.
name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
rawDisk Changes to this property will trigger replacement. Property Map
The parameters of the raw disk image. Structure is documented below.
sourceDisk Changes to this property will trigger replacement. 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.
sourceImage Changes to this property will trigger replacement. String
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
sourceSnapshot Changes to this property will trigger replacement. String
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
storageLocations Changes to this property will trigger replacement. List<String>
Cloud Storage bucket storage location of the image (regional or multi-regional). Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images

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.
EffectiveLabels Dictionary<string, string>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
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.
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
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.
EffectiveLabels map[string]string
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
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.
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
SelfLink string
The URI of the created resource.
archiveSizeBytes Integer
Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
creationTimestamp String
Creation timestamp in RFC3339 text format.
effectiveLabels Map<String,String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
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.
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
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.
effectiveLabels {[key: string]: string}
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
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.
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
selfLink string
The URI of the created resource.
archive_size_bytes int
Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
creation_timestamp str
Creation timestamp in RFC3339 text format.
effective_labels Mapping[str, str]
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
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.
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
self_link str
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.
effectiveLabels Map<String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
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.
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.
selfLink String
The URI of the created resource.

Look up 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
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        archive_size_bytes: Optional[int] = None,
        creation_timestamp: Optional[str] = None,
        description: Optional[str] = None,
        disk_size_gb: Optional[int] = None,
        effective_labels: Optional[Mapping[str, str]] = None,
        family: Optional[str] = None,
        guest_os_features: Optional[Sequence[ImageGuestOsFeatureArgs]] = None,
        image_encryption_key: Optional[ImageImageEncryptionKeyArgs] = None,
        label_fingerprint: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        licenses: Optional[Sequence[str]] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        pulumi_labels: Optional[Mapping[str, str]] = None,
        raw_disk: Optional[ImageRawDiskArgs] = None,
        self_link: Optional[str] = None,
        source_disk: Optional[str] = None,
        source_image: Optional[str] = None,
        source_snapshot: Optional[str] = None,
        storage_locations: Optional[Sequence[str]] = None) -> Image
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)
public static Image get(String name, Output<String> id, ImageState state, CustomResourceOptions options)
resources:  _:    type: gcp:compute:Image    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
DiskSizeGb Changes to this property will trigger replacement. int
Size of the image when restored onto a persistent disk (in GB).
EffectiveLabels Dictionary<string, string>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Family Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<ImageGuestOsFeature>
A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
ImageEncryptionKey Changes to this property will trigger replacement. ImageImageEncryptionKey
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.
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. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
Licenses Changes to this property will trigger replacement. List<string>
Any applicable license URI.
Name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
RawDisk Changes to this property will trigger replacement. ImageRawDisk
The parameters of the raw disk image. Structure is documented below.
SelfLink string
The URI of the created resource.
SourceDisk Changes to this property will trigger replacement. 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.
SourceImage Changes to this property will trigger replacement. string
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
SourceSnapshot Changes to this property will trigger replacement. string
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
StorageLocations Changes to this property will trigger replacement. List<string>
Cloud Storage bucket storage location of the image (regional or multi-regional). Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images
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 Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
DiskSizeGb Changes to this property will trigger replacement. int
Size of the image when restored onto a persistent disk (in GB).
EffectiveLabels map[string]string
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Family Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. []ImageGuestOsFeatureArgs
A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
ImageEncryptionKey Changes to this property will trigger replacement. ImageImageEncryptionKeyArgs
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.
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. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
Licenses Changes to this property will trigger replacement. []string
Any applicable license URI.
Name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
RawDisk Changes to this property will trigger replacement. ImageRawDiskArgs
The parameters of the raw disk image. Structure is documented below.
SelfLink string
The URI of the created resource.
SourceDisk Changes to this property will trigger replacement. 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.
SourceImage Changes to this property will trigger replacement. string
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
SourceSnapshot Changes to this property will trigger replacement. string
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
StorageLocations Changes to this property will trigger replacement. []string
Cloud Storage bucket storage location of the image (regional or multi-regional). Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images
archiveSizeBytes Integer
Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
creationTimestamp String
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. String
An optional description of this resource. Provide this property when you create the resource.
diskSizeGb Changes to this property will trigger replacement. Integer
Size of the image when restored onto a persistent disk (in GB).
effectiveLabels Map<String,String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
family Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<ImageGuestOsFeature>
A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
imageEncryptionKey Changes to this property will trigger replacement. ImageImageEncryptionKey
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.
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. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
licenses Changes to this property will trigger replacement. List<String>
Any applicable license URI.
name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
rawDisk Changes to this property will trigger replacement. ImageRawDisk
The parameters of the raw disk image. Structure is documented below.
selfLink String
The URI of the created resource.
sourceDisk Changes to this property will trigger replacement. 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.
sourceImage Changes to this property will trigger replacement. String
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
sourceSnapshot Changes to this property will trigger replacement. String
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
storageLocations Changes to this property will trigger replacement. List<String>
Cloud Storage bucket storage location of the image (regional or multi-regional). Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images
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 Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
diskSizeGb Changes to this property will trigger replacement. number
Size of the image when restored onto a persistent disk (in GB).
effectiveLabels {[key: string]: string}
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
family Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. ImageGuestOsFeature[]
A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
imageEncryptionKey Changes to this property will trigger replacement. ImageImageEncryptionKey
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.
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. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.
licenses Changes to this property will trigger replacement. string[]
Any applicable license URI.
name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
rawDisk Changes to this property will trigger replacement. ImageRawDisk
The parameters of the raw disk image. Structure is documented below.
selfLink string
The URI of the created resource.
sourceDisk Changes to this property will trigger replacement. 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.
sourceImage Changes to this property will trigger replacement. string
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
sourceSnapshot Changes to this property will trigger replacement. string
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
storageLocations Changes to this property will trigger replacement. string[]
Cloud Storage bucket storage location of the image (regional or multi-regional). Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images
archive_size_bytes int
Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
creation_timestamp str
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. str
An optional description of this resource. Provide this property when you create the resource.
disk_size_gb Changes to this property will trigger replacement. int
Size of the image when restored onto a persistent disk (in GB).
effective_labels Mapping[str, str]
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
family Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Sequence[ImageGuestOsFeatureArgs]
A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
image_encryption_key Changes to this property will trigger replacement. ImageImageEncryptionKeyArgs
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.
label_fingerprint str
The fingerprint used for optimistic locking of this resource. Used internally during updates.
labels Mapping[str, str]
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 effective_labels for all of the labels present on the resource.
licenses Changes to this property will trigger replacement. Sequence[str]
Any applicable license URI.
name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
raw_disk Changes to this property will trigger replacement. ImageRawDiskArgs
The parameters of the raw disk image. Structure is documented below.
self_link str
The URI of the created resource.
source_disk Changes to this property will trigger replacement. 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.
source_image Changes to this property will trigger replacement. str
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
source_snapshot Changes to this property will trigger replacement. str
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
storage_locations Changes to this property will trigger replacement. Sequence[str]
Cloud Storage bucket storage location of the image (regional or multi-regional). Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images
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 Changes to this property will trigger replacement. String
An optional description of this resource. Provide this property when you create the resource.
diskSizeGb Changes to this property will trigger replacement. Number
Size of the image when restored onto a persistent disk (in GB).
effectiveLabels Map<String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
family Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<Property Map>
A list of features to enable on the guest operating system. Applicable only for bootable images. Structure is documented below.
imageEncryptionKey Changes to this property will trigger replacement. Property Map
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.
labelFingerprint String
The fingerprint used for optimistic locking of this resource. Used internally during updates.
labels Map<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 effective_labels for all of the labels present on the resource.
licenses Changes to this property will trigger replacement. List<String>
Any applicable license URI.
name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.
rawDisk Changes to this property will trigger replacement. Property Map
The parameters of the raw disk image. Structure is documented below.
selfLink String
The URI of the created resource.
sourceDisk Changes to this property will trigger replacement. 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.
sourceImage Changes to this property will trigger replacement. String
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
sourceSnapshot Changes to this property will trigger replacement. String
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
storageLocations Changes to this property will trigger replacement. List<String>
Cloud Storage bucket storage location of the image (regional or multi-regional). Reference link: https://cloud.google.com/compute/docs/reference/rest/v1/images

Supporting Types

ImageGuestOsFeature
, ImageGuestOsFeatureArgs

Type
This property is required.
Changes to this property will trigger replacement.
string
The type of supported feature. Read Enabling guest operating system features to see a list of available options. Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, IDPF, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE, SEV_LIVE_MIGRATABLE_V2.
Type
This property is required.
Changes to this property will trigger replacement.
string
The type of supported feature. Read Enabling guest operating system features to see a list of available options. Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, IDPF, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE, SEV_LIVE_MIGRATABLE_V2.
type
This property is required.
Changes to this property will trigger replacement.
String
The type of supported feature. Read Enabling guest operating system features to see a list of available options. Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, IDPF, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE, SEV_LIVE_MIGRATABLE_V2.
type
This property is required.
Changes to this property will trigger replacement.
string
The type of supported feature. Read Enabling guest operating system features to see a list of available options. Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, IDPF, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE, SEV_LIVE_MIGRATABLE_V2.
type
This property is required.
Changes to this property will trigger replacement.
str
The type of supported feature. Read Enabling guest operating system features to see a list of available options. Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, IDPF, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE, SEV_LIVE_MIGRATABLE_V2.
type
This property is required.
Changes to this property will trigger replacement.
String
The type of supported feature. Read Enabling guest operating system features to see a list of available options. Possible values are: MULTI_IP_SUBNET, SECURE_BOOT, SEV_CAPABLE, UEFI_COMPATIBLE, VIRTIO_SCSI_MULTIQUEUE, WINDOWS, GVNIC, IDPF, SEV_LIVE_MIGRATABLE, SEV_SNP_CAPABLE, SUSPEND_RESUME_COMPATIBLE, TDX_CAPABLE, SEV_LIVE_MIGRATABLE_V2.

ImageImageEncryptionKey
, ImageImageEncryptionKeyArgs

KmsKeySelfLink Changes to this property will trigger replacement. string
The self link of the encryption key that is stored in Google Cloud KMS.
KmsKeyServiceAccount Changes to this property will trigger replacement. string
The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
KmsKeySelfLink Changes to this property will trigger replacement. string
The self link of the encryption key that is stored in Google Cloud KMS.
KmsKeyServiceAccount Changes to this property will trigger replacement. string
The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
kmsKeySelfLink Changes to this property will trigger replacement. String
The self link of the encryption key that is stored in Google Cloud KMS.
kmsKeyServiceAccount Changes to this property will trigger replacement. String
The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
kmsKeySelfLink Changes to this property will trigger replacement. string
The self link of the encryption key that is stored in Google Cloud KMS.
kmsKeyServiceAccount Changes to this property will trigger replacement. string
The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
kms_key_self_link Changes to this property will trigger replacement. str
The self link of the encryption key that is stored in Google Cloud KMS.
kms_key_service_account Changes to this property will trigger replacement. str
The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
kmsKeySelfLink Changes to this property will trigger replacement. String
The self link of the encryption key that is stored in Google Cloud KMS.
kmsKeyServiceAccount Changes to this property will trigger replacement. String
The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.

ImageRawDisk
, ImageRawDiskArgs

Source
This property is required.
Changes to this property will trigger replacement.
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 Changes to this property will trigger replacement. 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. Default value is TAR. Possible values are: TAR.
Sha1 Changes to this property will trigger replacement. string
An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.
Source
This property is required.
Changes to this property will trigger replacement.
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 Changes to this property will trigger replacement. 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. Default value is TAR. Possible values are: TAR.
Sha1 Changes to this property will trigger replacement. string
An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.
source
This property is required.
Changes to this property will trigger replacement.
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 Changes to this property will trigger replacement. 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. Default value is TAR. Possible values are: TAR.
sha1 Changes to this property will trigger replacement. String
An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.
source
This property is required.
Changes to this property will trigger replacement.
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 Changes to this property will trigger replacement. 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. Default value is TAR. Possible values are: TAR.
sha1 Changes to this property will trigger replacement. string
An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.
source
This property is required.
Changes to this property will trigger replacement.
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 Changes to this property will trigger replacement. 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. Default value is TAR. Possible values are: TAR.
sha1 Changes to this property will trigger replacement. str
An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.
source
This property is required.
Changes to this property will trigger replacement.
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 Changes to this property will trigger replacement. 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. Default value is TAR. Possible values are: TAR.
sha1 Changes to this property will trigger replacement. String
An optional SHA1 checksum of the disk image before unpackaging. This is provided by the client when the disk image is created.

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:

$ pulumi import gcp:compute/image:Image default projects/{{project}}/global/images/{{name}}
Copy
$ pulumi import gcp:compute/image:Image default {{project}}/{{name}}
Copy
$ pulumi import gcp:compute/image:Image default {{name}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.