1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. MachineImage
Google Cloud Classic v7.2.1 published on Wednesday, Nov 22, 2023 by Pulumi

gcp.compute.MachineImage

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.2.1 published on Wednesday, Nov 22, 2023 by Pulumi

    Represents a Machine Image resource. Machine images store all the configuration, metadata, permissions, and data from one or more disks required to create a Virtual machine (VM) instance.

    To get more information about MachineImage, see:

    Example Usage

    Machine Image Basic

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var vm = new Gcp.Compute.Instance("vm", new()
        {
            MachineType = "e2-medium",
            BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
            {
                InitializeParams = new Gcp.Compute.Inputs.InstanceBootDiskInitializeParamsArgs
                {
                    Image = "debian-cloud/debian-11",
                },
            },
            NetworkInterfaces = new[]
            {
                new Gcp.Compute.Inputs.InstanceNetworkInterfaceArgs
                {
                    Network = "default",
                },
            },
        }, new CustomResourceOptions
        {
            Provider = google_beta,
        });
    
        var image = new Gcp.Compute.MachineImage("image", new()
        {
            SourceInstance = vm.SelfLink,
        }, new CustomResourceOptions
        {
            Provider = google_beta,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		vm, err := compute.NewInstance(ctx, "vm", &compute.InstanceArgs{
    			MachineType: pulumi.String("e2-medium"),
    			BootDisk: &compute.InstanceBootDiskArgs{
    				InitializeParams: &compute.InstanceBootDiskInitializeParamsArgs{
    					Image: pulumi.String("debian-cloud/debian-11"),
    				},
    			},
    			NetworkInterfaces: compute.InstanceNetworkInterfaceArray{
    				&compute.InstanceNetworkInterfaceArgs{
    					Network: pulumi.String("default"),
    				},
    			},
    		}, pulumi.Provider(google_beta))
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewMachineImage(ctx, "image", &compute.MachineImageArgs{
    			SourceInstance: vm.SelfLink,
    		}, pulumi.Provider(google_beta))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.Instance;
    import com.pulumi.gcp.compute.InstanceArgs;
    import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
    import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
    import com.pulumi.gcp.compute.inputs.InstanceNetworkInterfaceArgs;
    import com.pulumi.gcp.compute.MachineImage;
    import com.pulumi.gcp.compute.MachineImageArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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) {
            var vm = new Instance("vm", InstanceArgs.builder()        
                .machineType("e2-medium")
                .bootDisk(InstanceBootDiskArgs.builder()
                    .initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
                        .image("debian-cloud/debian-11")
                        .build())
                    .build())
                .networkInterfaces(InstanceNetworkInterfaceArgs.builder()
                    .network("default")
                    .build())
                .build(), CustomResourceOptions.builder()
                    .provider(google_beta)
                    .build());
    
            var image = new MachineImage("image", MachineImageArgs.builder()        
                .sourceInstance(vm.selfLink())
                .build(), CustomResourceOptions.builder()
                    .provider(google_beta)
                    .build());
    
        }
    }
    
    import pulumi
    import pulumi_gcp as gcp
    
    vm = gcp.compute.Instance("vm",
        machine_type="e2-medium",
        boot_disk=gcp.compute.InstanceBootDiskArgs(
            initialize_params=gcp.compute.InstanceBootDiskInitializeParamsArgs(
                image="debian-cloud/debian-11",
            ),
        ),
        network_interfaces=[gcp.compute.InstanceNetworkInterfaceArgs(
            network="default",
        )],
        opts=pulumi.ResourceOptions(provider=google_beta))
    image = gcp.compute.MachineImage("image", source_instance=vm.self_link,
    opts=pulumi.ResourceOptions(provider=google_beta))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const vm = new gcp.compute.Instance("vm", {
        machineType: "e2-medium",
        bootDisk: {
            initializeParams: {
                image: "debian-cloud/debian-11",
            },
        },
        networkInterfaces: [{
            network: "default",
        }],
    }, {
        provider: google_beta,
    });
    const image = new gcp.compute.MachineImage("image", {sourceInstance: vm.selfLink}, {
        provider: google_beta,
    });
    
    resources:
      vm:
        type: gcp:compute:Instance
        properties:
          machineType: e2-medium
          bootDisk:
            initializeParams:
              image: debian-cloud/debian-11
          networkInterfaces:
            - network: default
        options:
          provider: ${["google-beta"]}
      image:
        type: gcp:compute:MachineImage
        properties:
          sourceInstance: ${vm.selfLink}
        options:
          provider: ${["google-beta"]}
    

    Compute Machine Image Kms

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var vm = new Gcp.Compute.Instance("vm", new()
        {
            MachineType = "e2-medium",
            BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
            {
                InitializeParams = new Gcp.Compute.Inputs.InstanceBootDiskInitializeParamsArgs
                {
                    Image = "debian-cloud/debian-11",
                },
            },
            NetworkInterfaces = new[]
            {
                new Gcp.Compute.Inputs.InstanceNetworkInterfaceArgs
                {
                    Network = "default",
                },
            },
        }, new CustomResourceOptions
        {
            Provider = google_beta,
        });
    
        var keyRing = new Gcp.Kms.KeyRing("keyRing", new()
        {
            Location = "us",
        }, new CustomResourceOptions
        {
            Provider = google_beta,
        });
    
        var cryptoKey = new Gcp.Kms.CryptoKey("cryptoKey", new()
        {
            KeyRing = keyRing.Id,
        }, new CustomResourceOptions
        {
            Provider = google_beta,
        });
    
        var image = new Gcp.Compute.MachineImage("image", new()
        {
            SourceInstance = vm.SelfLink,
            MachineImageEncryptionKey = new Gcp.Compute.Inputs.MachineImageMachineImageEncryptionKeyArgs
            {
                KmsKeyName = cryptoKey.Id,
            },
        }, new CustomResourceOptions
        {
            Provider = google_beta,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		vm, err := compute.NewInstance(ctx, "vm", &compute.InstanceArgs{
    			MachineType: pulumi.String("e2-medium"),
    			BootDisk: &compute.InstanceBootDiskArgs{
    				InitializeParams: &compute.InstanceBootDiskInitializeParamsArgs{
    					Image: pulumi.String("debian-cloud/debian-11"),
    				},
    			},
    			NetworkInterfaces: compute.InstanceNetworkInterfaceArray{
    				&compute.InstanceNetworkInterfaceArgs{
    					Network: pulumi.String("default"),
    				},
    			},
    		}, pulumi.Provider(google_beta))
    		if err != nil {
    			return err
    		}
    		keyRing, err := kms.NewKeyRing(ctx, "keyRing", &kms.KeyRingArgs{
    			Location: pulumi.String("us"),
    		}, pulumi.Provider(google_beta))
    		if err != nil {
    			return err
    		}
    		cryptoKey, err := kms.NewCryptoKey(ctx, "cryptoKey", &kms.CryptoKeyArgs{
    			KeyRing: keyRing.ID(),
    		}, pulumi.Provider(google_beta))
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewMachineImage(ctx, "image", &compute.MachineImageArgs{
    			SourceInstance: vm.SelfLink,
    			MachineImageEncryptionKey: &compute.MachineImageMachineImageEncryptionKeyArgs{
    				KmsKeyName: cryptoKey.ID(),
    			},
    		}, pulumi.Provider(google_beta))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.Instance;
    import com.pulumi.gcp.compute.InstanceArgs;
    import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
    import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
    import com.pulumi.gcp.compute.inputs.InstanceNetworkInterfaceArgs;
    import com.pulumi.gcp.kms.KeyRing;
    import com.pulumi.gcp.kms.KeyRingArgs;
    import com.pulumi.gcp.kms.CryptoKey;
    import com.pulumi.gcp.kms.CryptoKeyArgs;
    import com.pulumi.gcp.compute.MachineImage;
    import com.pulumi.gcp.compute.MachineImageArgs;
    import com.pulumi.gcp.compute.inputs.MachineImageMachineImageEncryptionKeyArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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) {
            var vm = new Instance("vm", InstanceArgs.builder()        
                .machineType("e2-medium")
                .bootDisk(InstanceBootDiskArgs.builder()
                    .initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
                        .image("debian-cloud/debian-11")
                        .build())
                    .build())
                .networkInterfaces(InstanceNetworkInterfaceArgs.builder()
                    .network("default")
                    .build())
                .build(), CustomResourceOptions.builder()
                    .provider(google_beta)
                    .build());
    
            var keyRing = new KeyRing("keyRing", KeyRingArgs.builder()        
                .location("us")
                .build(), CustomResourceOptions.builder()
                    .provider(google_beta)
                    .build());
    
            var cryptoKey = new CryptoKey("cryptoKey", CryptoKeyArgs.builder()        
                .keyRing(keyRing.id())
                .build(), CustomResourceOptions.builder()
                    .provider(google_beta)
                    .build());
    
            var image = new MachineImage("image", MachineImageArgs.builder()        
                .sourceInstance(vm.selfLink())
                .machineImageEncryptionKey(MachineImageMachineImageEncryptionKeyArgs.builder()
                    .kmsKeyName(cryptoKey.id())
                    .build())
                .build(), CustomResourceOptions.builder()
                    .provider(google_beta)
                    .build());
    
        }
    }
    
    import pulumi
    import pulumi_gcp as gcp
    
    vm = gcp.compute.Instance("vm",
        machine_type="e2-medium",
        boot_disk=gcp.compute.InstanceBootDiskArgs(
            initialize_params=gcp.compute.InstanceBootDiskInitializeParamsArgs(
                image="debian-cloud/debian-11",
            ),
        ),
        network_interfaces=[gcp.compute.InstanceNetworkInterfaceArgs(
            network="default",
        )],
        opts=pulumi.ResourceOptions(provider=google_beta))
    key_ring = gcp.kms.KeyRing("keyRing", location="us",
    opts=pulumi.ResourceOptions(provider=google_beta))
    crypto_key = gcp.kms.CryptoKey("cryptoKey", key_ring=key_ring.id,
    opts=pulumi.ResourceOptions(provider=google_beta))
    image = gcp.compute.MachineImage("image",
        source_instance=vm.self_link,
        machine_image_encryption_key=gcp.compute.MachineImageMachineImageEncryptionKeyArgs(
            kms_key_name=crypto_key.id,
        ),
        opts=pulumi.ResourceOptions(provider=google_beta))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const vm = new gcp.compute.Instance("vm", {
        machineType: "e2-medium",
        bootDisk: {
            initializeParams: {
                image: "debian-cloud/debian-11",
            },
        },
        networkInterfaces: [{
            network: "default",
        }],
    }, {
        provider: google_beta,
    });
    const keyRing = new gcp.kms.KeyRing("keyRing", {location: "us"}, {
        provider: google_beta,
    });
    const cryptoKey = new gcp.kms.CryptoKey("cryptoKey", {keyRing: keyRing.id}, {
        provider: google_beta,
    });
    const image = new gcp.compute.MachineImage("image", {
        sourceInstance: vm.selfLink,
        machineImageEncryptionKey: {
            kmsKeyName: cryptoKey.id,
        },
    }, {
        provider: google_beta,
    });
    
    resources:
      vm:
        type: gcp:compute:Instance
        properties:
          machineType: e2-medium
          bootDisk:
            initializeParams:
              image: debian-cloud/debian-11
          networkInterfaces:
            - network: default
        options:
          provider: ${["google-beta"]}
      image:
        type: gcp:compute:MachineImage
        properties:
          sourceInstance: ${vm.selfLink}
          machineImageEncryptionKey:
            kmsKeyName: ${cryptoKey.id}
        options:
          provider: ${["google-beta"]}
      cryptoKey:
        type: gcp:kms:CryptoKey
        properties:
          keyRing: ${keyRing.id}
        options:
          provider: ${["google-beta"]}
      keyRing:
        type: gcp:kms:KeyRing
        properties:
          location: us
        options:
          provider: ${["google-beta"]}
    

    Create MachineImage Resource

    new MachineImage(name: string, args: MachineImageArgs, opts?: CustomResourceOptions);
    @overload
    def MachineImage(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     description: Optional[str] = None,
                     guest_flush: Optional[bool] = None,
                     machine_image_encryption_key: Optional[MachineImageMachineImageEncryptionKeyArgs] = None,
                     name: Optional[str] = None,
                     project: Optional[str] = None,
                     source_instance: Optional[str] = None)
    @overload
    def MachineImage(resource_name: str,
                     args: MachineImageArgs,
                     opts: Optional[ResourceOptions] = None)
    func NewMachineImage(ctx *Context, name string, args MachineImageArgs, opts ...ResourceOption) (*MachineImage, error)
    public MachineImage(string name, MachineImageArgs args, CustomResourceOptions? opts = null)
    public MachineImage(String name, MachineImageArgs args)
    public MachineImage(String name, MachineImageArgs args, CustomResourceOptions options)
    
    type: gcp:compute:MachineImage
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args MachineImageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args MachineImageArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args MachineImageArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MachineImageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MachineImageArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    MachineImage Resource Properties

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

    Inputs

    The MachineImage resource accepts the following input properties:

    SourceInstance string

    The source instance used to create the machine image. You can provide this as a partial or full URL to the resource.


    Description string

    A text description of the resource.

    GuestFlush bool

    Specify this to create an application consistent machine image by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).

    MachineImageEncryptionKey MachineImageMachineImageEncryptionKey

    Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image with a customer-supplied key, you must provide the same key if you use the machine image later (e.g. to create a instance from the image) Structure is documented below.

    Name string

    Name of the resource.

    Project string

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

    SourceInstance string

    The source instance used to create the machine image. You can provide this as a partial or full URL to the resource.


    Description string

    A text description of the resource.

    GuestFlush bool

    Specify this to create an application consistent machine image by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).

    MachineImageEncryptionKey MachineImageMachineImageEncryptionKeyArgs

    Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image with a customer-supplied key, you must provide the same key if you use the machine image later (e.g. to create a instance from the image) Structure is documented below.

    Name string

    Name of the resource.

    Project string

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

    sourceInstance String

    The source instance used to create the machine image. You can provide this as a partial or full URL to the resource.


    description String

    A text description of the resource.

    guestFlush Boolean

    Specify this to create an application consistent machine image by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).

    machineImageEncryptionKey MachineImageMachineImageEncryptionKey

    Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image with a customer-supplied key, you must provide the same key if you use the machine image later (e.g. to create a instance from the image) Structure is documented below.

    name String

    Name of the resource.

    project String

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

    sourceInstance string

    The source instance used to create the machine image. You can provide this as a partial or full URL to the resource.


    description string

    A text description of the resource.

    guestFlush boolean

    Specify this to create an application consistent machine image by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).

    machineImageEncryptionKey MachineImageMachineImageEncryptionKey

    Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image with a customer-supplied key, you must provide the same key if you use the machine image later (e.g. to create a instance from the image) Structure is documented below.

    name string

    Name of the resource.

    project string

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

    source_instance str

    The source instance used to create the machine image. You can provide this as a partial or full URL to the resource.


    description str

    A text description of the resource.

    guest_flush bool

    Specify this to create an application consistent machine image by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).

    machine_image_encryption_key MachineImageMachineImageEncryptionKeyArgs

    Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image with a customer-supplied key, you must provide the same key if you use the machine image later (e.g. to create a instance from the image) Structure is documented below.

    name str

    Name of the resource.

    project str

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

    sourceInstance String

    The source instance used to create the machine image. You can provide this as a partial or full URL to the resource.


    description String

    A text description of the resource.

    guestFlush Boolean

    Specify this to create an application consistent machine image by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).

    machineImageEncryptionKey Property Map

    Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image with a customer-supplied key, you must provide the same key if you use the machine image later (e.g. to create a instance from the image) Structure is documented below.

    name String

    Name of the resource.

    project String

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

    Outputs

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

    Id string

    The provider-assigned unique ID for this managed resource.

    SelfLink string

    The URI of the created resource.

    StorageLocations List<string>

    The regional or multi-regional Cloud Storage bucket location where the machine image is stored.

    Id string

    The provider-assigned unique ID for this managed resource.

    SelfLink string

    The URI of the created resource.

    StorageLocations []string

    The regional or multi-regional Cloud Storage bucket location where the machine image is stored.

    id String

    The provider-assigned unique ID for this managed resource.

    selfLink String

    The URI of the created resource.

    storageLocations List<String>

    The regional or multi-regional Cloud Storage bucket location where the machine image is stored.

    id string

    The provider-assigned unique ID for this managed resource.

    selfLink string

    The URI of the created resource.

    storageLocations string[]

    The regional or multi-regional Cloud Storage bucket location where the machine image is stored.

    id str

    The provider-assigned unique ID for this managed resource.

    self_link str

    The URI of the created resource.

    storage_locations Sequence[str]

    The regional or multi-regional Cloud Storage bucket location where the machine image is stored.

    id String

    The provider-assigned unique ID for this managed resource.

    selfLink String

    The URI of the created resource.

    storageLocations List<String>

    The regional or multi-regional Cloud Storage bucket location where the machine image is stored.

    Look up Existing MachineImage Resource

    Get an existing MachineImage 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?: MachineImageState, opts?: CustomResourceOptions): MachineImage
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            guest_flush: Optional[bool] = None,
            machine_image_encryption_key: Optional[MachineImageMachineImageEncryptionKeyArgs] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            self_link: Optional[str] = None,
            source_instance: Optional[str] = None,
            storage_locations: Optional[Sequence[str]] = None) -> MachineImage
    func GetMachineImage(ctx *Context, name string, id IDInput, state *MachineImageState, opts ...ResourceOption) (*MachineImage, error)
    public static MachineImage Get(string name, Input<string> id, MachineImageState? state, CustomResourceOptions? opts = null)
    public static MachineImage get(String name, Output<String> id, MachineImageState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Description string

    A text description of the resource.

    GuestFlush bool

    Specify this to create an application consistent machine image by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).

    MachineImageEncryptionKey MachineImageMachineImageEncryptionKey

    Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image with a customer-supplied key, you must provide the same key if you use the machine image later (e.g. to create a instance from the image) Structure is documented below.

    Name string

    Name of the resource.

    Project string

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

    SelfLink string

    The URI of the created resource.

    SourceInstance string

    The source instance used to create the machine image. You can provide this as a partial or full URL to the resource.


    StorageLocations List<string>

    The regional or multi-regional Cloud Storage bucket location where the machine image is stored.

    Description string

    A text description of the resource.

    GuestFlush bool

    Specify this to create an application consistent machine image by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).

    MachineImageEncryptionKey MachineImageMachineImageEncryptionKeyArgs

    Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image with a customer-supplied key, you must provide the same key if you use the machine image later (e.g. to create a instance from the image) Structure is documented below.

    Name string

    Name of the resource.

    Project string

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

    SelfLink string

    The URI of the created resource.

    SourceInstance string

    The source instance used to create the machine image. You can provide this as a partial or full URL to the resource.


    StorageLocations []string

    The regional or multi-regional Cloud Storage bucket location where the machine image is stored.

    description String

    A text description of the resource.

    guestFlush Boolean

    Specify this to create an application consistent machine image by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).

    machineImageEncryptionKey MachineImageMachineImageEncryptionKey

    Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image with a customer-supplied key, you must provide the same key if you use the machine image later (e.g. to create a instance from the image) Structure is documented below.

    name String

    Name of the resource.

    project String

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

    selfLink String

    The URI of the created resource.

    sourceInstance String

    The source instance used to create the machine image. You can provide this as a partial or full URL to the resource.


    storageLocations List<String>

    The regional or multi-regional Cloud Storage bucket location where the machine image is stored.

    description string

    A text description of the resource.

    guestFlush boolean

    Specify this to create an application consistent machine image by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).

    machineImageEncryptionKey MachineImageMachineImageEncryptionKey

    Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image with a customer-supplied key, you must provide the same key if you use the machine image later (e.g. to create a instance from the image) Structure is documented below.

    name string

    Name of the resource.

    project string

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

    selfLink string

    The URI of the created resource.

    sourceInstance string

    The source instance used to create the machine image. You can provide this as a partial or full URL to the resource.


    storageLocations string[]

    The regional or multi-regional Cloud Storage bucket location where the machine image is stored.

    description str

    A text description of the resource.

    guest_flush bool

    Specify this to create an application consistent machine image by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).

    machine_image_encryption_key MachineImageMachineImageEncryptionKeyArgs

    Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image with a customer-supplied key, you must provide the same key if you use the machine image later (e.g. to create a instance from the image) Structure is documented below.

    name str

    Name of the resource.

    project str

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

    self_link str

    The URI of the created resource.

    source_instance str

    The source instance used to create the machine image. You can provide this as a partial or full URL to the resource.


    storage_locations Sequence[str]

    The regional or multi-regional Cloud Storage bucket location where the machine image is stored.

    description String

    A text description of the resource.

    guestFlush Boolean

    Specify this to create an application consistent machine image by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).

    machineImageEncryptionKey Property Map

    Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image with a customer-supplied key, you must provide the same key if you use the machine image later (e.g. to create a instance from the image) Structure is documented below.

    name String

    Name of the resource.

    project String

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

    selfLink String

    The URI of the created resource.

    sourceInstance String

    The source instance used to create the machine image. You can provide this as a partial or full URL to the resource.


    storageLocations List<String>

    The regional or multi-regional Cloud Storage bucket location where the machine image is stored.

    Supporting Types

    MachineImageMachineImageEncryptionKey, MachineImageMachineImageEncryptionKeyArgs

    KmsKeyName string

    The name of the encryption key that is stored in Google Cloud KMS.

    KmsKeyServiceAccount string

    The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

    RawKey string

    Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

    Sha256 string

    (Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

    KmsKeyName string

    The name of the encryption key that is stored in Google Cloud KMS.

    KmsKeyServiceAccount string

    The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

    RawKey string

    Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

    Sha256 string

    (Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

    kmsKeyName String

    The name of the encryption key that is stored in Google Cloud KMS.

    kmsKeyServiceAccount String

    The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

    rawKey String

    Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

    sha256 String

    (Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

    kmsKeyName string

    The name of the encryption key that is stored in Google Cloud KMS.

    kmsKeyServiceAccount string

    The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

    rawKey string

    Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

    sha256 string

    (Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

    kms_key_name str

    The name of the encryption key that is stored in Google Cloud KMS.

    kms_key_service_account str

    The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

    raw_key str

    Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

    sha256 str

    (Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

    kmsKeyName String

    The name of the encryption key that is stored in Google Cloud KMS.

    kmsKeyServiceAccount String

    The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

    rawKey String

    Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

    sha256 String

    (Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

    Import

    MachineImage can be imported using any of these accepted formats* projects/{{project}}/global/machineImages/{{name}} * {{project}}/{{name}} * {{name}} In Terraform v1.5.0 and later, use an import block to import MachineImage using one of the formats above. For exampletf import {

    id = “projects/{{project}}/global/machineImages/{{name}}”

    to = google_compute_machine_image.default }

     $ pulumi import gcp:compute/machineImage:MachineImage When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), MachineImage can be imported using one of the formats above. For example
    
     $ pulumi import gcp:compute/machineImage:MachineImage default projects/{{project}}/global/machineImages/{{name}}
    
     $ pulumi import gcp:compute/machineImage:MachineImage default {{project}}/{{name}}
    
     $ pulumi import gcp:compute/machineImage:MachineImage default {{name}}
    

    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.

    gcp logo
    Google Cloud Classic v7.2.1 published on Wednesday, Nov 22, 2023 by Pulumi