Show / Hide Table of Contents

Class 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
  • Official Documentation

Example Usage - Image Basic

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var example = new Gcp.Compute.Image("example", new Gcp.Compute.ImageArgs
    {
        RawDisk = new Gcp.Compute.Inputs.ImageRawDiskArgs
        {
            Source = "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz",
        },
    });
}

}

Example Usage - Image Guest Os

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var example = new Gcp.Compute.Image("example", new Gcp.Compute.ImageArgs
    {
        GuestOsFeatures = 
        {
            new Gcp.Compute.Inputs.ImageGuestOsFeatureArgs
            {
                Type = "SECURE_BOOT",
            },
            new Gcp.Compute.Inputs.ImageGuestOsFeatureArgs
            {
                Type = "MULTI_IP_SUBNET",
            },
        },
        RawDisk = new Gcp.Compute.Inputs.ImageRawDiskArgs
        {
            Source = "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz",
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Image
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Gcp.Compute
Assembly: Pulumi.Gcp.dll
Syntax
public class Image : CustomResource

Constructors

View Source

Image(String, ImageArgs, CustomResourceOptions)

Create a Image resource with the given unique name, arguments, and options.

Declaration
public Image(string name, ImageArgs args = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

ImageArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

ArchiveSizeBytes

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

Declaration
public Output<int> ArchiveSizeBytes { get; }
Property Value
Type Description
Output<System.Int32>
View Source

CreationTimestamp

Creation timestamp in RFC3339 text format.

Declaration
public Output<string> CreationTimestamp { get; }
Property Value
Type Description
Output<System.String>
View Source

Description

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

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

DiskSizeGb

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

Declaration
public Output<int> DiskSizeGb { get; }
Property Value
Type Description
Output<System.Int32>
View Source

Family

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.

Declaration
public Output<string> Family { get; }
Property Value
Type Description
Output<System.String>
View Source

GuestOsFeatures

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

Declaration
public Output<ImmutableArray<ImageGuestOsFeature>> GuestOsFeatures { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<ImageGuestOsFeature>>
View Source

LabelFingerprint

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

Declaration
public Output<string> LabelFingerprint { get; }
Property Value
Type Description
Output<System.String>
View Source

Labels

Labels to apply to this Image.

Declaration
public Output<ImmutableDictionary<string, string>> Labels { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>>
View Source

Licenses

Any applicable license URI.

Declaration
public Output<ImmutableArray<string>> Licenses { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

Name

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.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Project

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

Declaration
public Output<string> Project { get; }
Property Value
Type Description
Output<System.String>
View Source

RawDisk

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

Declaration
public Output<ImageRawDisk> RawDisk { get; }
Property Value
Type Description
Output<ImageRawDisk>
View Source

SelfLink

The URI of the created resource.

Declaration
public Output<string> SelfLink { get; }
Property Value
Type Description
Output<System.String>
View Source

SourceDisk

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.

Declaration
public Output<string> SourceDisk { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, ImageState, CustomResourceOptions)

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

Declaration
public static Image Get(string name, Input<string> id, ImageState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

ImageState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Image
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.