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

gcp.compute.Reservation

Explore with Pulumi AI

Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running.

Reservations apply only to Compute Engine, Cloud Dataproc, and Google Kubernetes Engine VM usage.Reservations do not apply to f1-micro or g1-small machine types, preemptible VMs, sole tenant nodes, or other services not listed above like Cloud SQL and Dataflow.

To get more information about Reservation, see:

Example Usage

Reservation Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const gceReservation = new gcp.compute.Reservation("gce_reservation", {
    name: "gce-reservation",
    zone: "us-central1-a",
    specificReservation: {
        count: 1,
        instanceProperties: {
            minCpuPlatform: "Intel Cascade Lake",
            machineType: "n2-standard-2",
        },
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

gce_reservation = gcp.compute.Reservation("gce_reservation",
    name="gce-reservation",
    zone="us-central1-a",
    specific_reservation={
        "count": 1,
        "instance_properties": {
            "min_cpu_platform": "Intel Cascade Lake",
            "machine_type": "n2-standard-2",
        },
    })
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 {
		_, err := compute.NewReservation(ctx, "gce_reservation", &compute.ReservationArgs{
			Name: pulumi.String("gce-reservation"),
			Zone: pulumi.String("us-central1-a"),
			SpecificReservation: &compute.ReservationSpecificReservationArgs{
				Count: pulumi.Int(1),
				InstanceProperties: &compute.ReservationSpecificReservationInstancePropertiesArgs{
					MinCpuPlatform: pulumi.String("Intel Cascade Lake"),
					MachineType:    pulumi.String("n2-standard-2"),
				},
			},
		})
		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 gceReservation = new Gcp.Compute.Reservation("gce_reservation", new()
    {
        Name = "gce-reservation",
        Zone = "us-central1-a",
        SpecificReservation = new Gcp.Compute.Inputs.ReservationSpecificReservationArgs
        {
            Count = 1,
            InstanceProperties = new Gcp.Compute.Inputs.ReservationSpecificReservationInstancePropertiesArgs
            {
                MinCpuPlatform = "Intel Cascade Lake",
                MachineType = "n2-standard-2",
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Reservation;
import com.pulumi.gcp.compute.ReservationArgs;
import com.pulumi.gcp.compute.inputs.ReservationSpecificReservationArgs;
import com.pulumi.gcp.compute.inputs.ReservationSpecificReservationInstancePropertiesArgs;
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 gceReservation = new Reservation("gceReservation", ReservationArgs.builder()
            .name("gce-reservation")
            .zone("us-central1-a")
            .specificReservation(ReservationSpecificReservationArgs.builder()
                .count(1)
                .instanceProperties(ReservationSpecificReservationInstancePropertiesArgs.builder()
                    .minCpuPlatform("Intel Cascade Lake")
                    .machineType("n2-standard-2")
                    .build())
                .build())
            .build());

    }
}
Copy
resources:
  gceReservation:
    type: gcp:compute:Reservation
    name: gce_reservation
    properties:
      name: gce-reservation
      zone: us-central1-a
      specificReservation:
        count: 1
        instanceProperties:
          minCpuPlatform: Intel Cascade Lake
          machineType: n2-standard-2
Copy

Create Reservation Resource

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

Constructor syntax

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

@overload
def Reservation(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                specific_reservation: Optional[ReservationSpecificReservationArgs] = None,
                zone: Optional[str] = None,
                description: Optional[str] = None,
                name: Optional[str] = None,
                project: Optional[str] = None,
                share_settings: Optional[ReservationShareSettingsArgs] = None,
                specific_reservation_required: Optional[bool] = None)
func NewReservation(ctx *Context, name string, args ReservationArgs, opts ...ResourceOption) (*Reservation, error)
public Reservation(string name, ReservationArgs args, CustomResourceOptions? opts = null)
public Reservation(String name, ReservationArgs args)
public Reservation(String name, ReservationArgs args, CustomResourceOptions options)
type: gcp:compute:Reservation
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 This property is required. ReservationArgs
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 This property is required. ReservationArgs
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 This property is required. ReservationArgs
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 This property is required. ReservationArgs
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. ReservationArgs
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 gcpReservationResource = new Gcp.Compute.Reservation("gcpReservationResource", new()
{
    SpecificReservation = new Gcp.Compute.Inputs.ReservationSpecificReservationArgs
    {
        Count = 0,
        InstanceProperties = new Gcp.Compute.Inputs.ReservationSpecificReservationInstancePropertiesArgs
        {
            MachineType = "string",
            GuestAccelerators = new[]
            {
                new Gcp.Compute.Inputs.ReservationSpecificReservationInstancePropertiesGuestAcceleratorArgs
                {
                    AcceleratorCount = 0,
                    AcceleratorType = "string",
                },
            },
            LocalSsds = new[]
            {
                new Gcp.Compute.Inputs.ReservationSpecificReservationInstancePropertiesLocalSsdArgs
                {
                    DiskSizeGb = 0,
                    Interface = "string",
                },
            },
            MinCpuPlatform = "string",
        },
        InUseCount = 0,
    },
    Zone = "string",
    Description = "string",
    Name = "string",
    Project = "string",
    ShareSettings = new Gcp.Compute.Inputs.ReservationShareSettingsArgs
    {
        ProjectMaps = new[]
        {
            new Gcp.Compute.Inputs.ReservationShareSettingsProjectMapArgs
            {
                Id = "string",
                ProjectId = "string",
            },
        },
        ShareType = "string",
    },
    SpecificReservationRequired = false,
});
Copy
example, err := compute.NewReservation(ctx, "gcpReservationResource", &compute.ReservationArgs{
	SpecificReservation: &compute.ReservationSpecificReservationArgs{
		Count: pulumi.Int(0),
		InstanceProperties: &compute.ReservationSpecificReservationInstancePropertiesArgs{
			MachineType: pulumi.String("string"),
			GuestAccelerators: compute.ReservationSpecificReservationInstancePropertiesGuestAcceleratorArray{
				&compute.ReservationSpecificReservationInstancePropertiesGuestAcceleratorArgs{
					AcceleratorCount: pulumi.Int(0),
					AcceleratorType:  pulumi.String("string"),
				},
			},
			LocalSsds: compute.ReservationSpecificReservationInstancePropertiesLocalSsdArray{
				&compute.ReservationSpecificReservationInstancePropertiesLocalSsdArgs{
					DiskSizeGb: pulumi.Int(0),
					Interface:  pulumi.String("string"),
				},
			},
			MinCpuPlatform: pulumi.String("string"),
		},
		InUseCount: pulumi.Int(0),
	},
	Zone:        pulumi.String("string"),
	Description: pulumi.String("string"),
	Name:        pulumi.String("string"),
	Project:     pulumi.String("string"),
	ShareSettings: &compute.ReservationShareSettingsArgs{
		ProjectMaps: compute.ReservationShareSettingsProjectMapArray{
			&compute.ReservationShareSettingsProjectMapArgs{
				Id:        pulumi.String("string"),
				ProjectId: pulumi.String("string"),
			},
		},
		ShareType: pulumi.String("string"),
	},
	SpecificReservationRequired: pulumi.Bool(false),
})
Copy
var gcpReservationResource = new Reservation("gcpReservationResource", ReservationArgs.builder()
    .specificReservation(ReservationSpecificReservationArgs.builder()
        .count(0)
        .instanceProperties(ReservationSpecificReservationInstancePropertiesArgs.builder()
            .machineType("string")
            .guestAccelerators(ReservationSpecificReservationInstancePropertiesGuestAcceleratorArgs.builder()
                .acceleratorCount(0)
                .acceleratorType("string")
                .build())
            .localSsds(ReservationSpecificReservationInstancePropertiesLocalSsdArgs.builder()
                .diskSizeGb(0)
                .interface_("string")
                .build())
            .minCpuPlatform("string")
            .build())
        .inUseCount(0)
        .build())
    .zone("string")
    .description("string")
    .name("string")
    .project("string")
    .shareSettings(ReservationShareSettingsArgs.builder()
        .projectMaps(ReservationShareSettingsProjectMapArgs.builder()
            .id("string")
            .projectId("string")
            .build())
        .shareType("string")
        .build())
    .specificReservationRequired(false)
    .build());
Copy
gcp_reservation_resource = gcp.compute.Reservation("gcpReservationResource",
    specific_reservation={
        "count": 0,
        "instance_properties": {
            "machine_type": "string",
            "guest_accelerators": [{
                "accelerator_count": 0,
                "accelerator_type": "string",
            }],
            "local_ssds": [{
                "disk_size_gb": 0,
                "interface": "string",
            }],
            "min_cpu_platform": "string",
        },
        "in_use_count": 0,
    },
    zone="string",
    description="string",
    name="string",
    project="string",
    share_settings={
        "project_maps": [{
            "id": "string",
            "project_id": "string",
        }],
        "share_type": "string",
    },
    specific_reservation_required=False)
Copy
const gcpReservationResource = new gcp.compute.Reservation("gcpReservationResource", {
    specificReservation: {
        count: 0,
        instanceProperties: {
            machineType: "string",
            guestAccelerators: [{
                acceleratorCount: 0,
                acceleratorType: "string",
            }],
            localSsds: [{
                diskSizeGb: 0,
                "interface": "string",
            }],
            minCpuPlatform: "string",
        },
        inUseCount: 0,
    },
    zone: "string",
    description: "string",
    name: "string",
    project: "string",
    shareSettings: {
        projectMaps: [{
            id: "string",
            projectId: "string",
        }],
        shareType: "string",
    },
    specificReservationRequired: false,
});
Copy
type: gcp:compute:Reservation
properties:
    description: string
    name: string
    project: string
    shareSettings:
        projectMaps:
            - id: string
              projectId: string
        shareType: string
    specificReservation:
        count: 0
        inUseCount: 0
        instanceProperties:
            guestAccelerators:
                - acceleratorCount: 0
                  acceleratorType: string
            localSsds:
                - diskSizeGb: 0
                  interface: string
            machineType: string
            minCpuPlatform: string
    specificReservationRequired: false
    zone: string
Copy

Reservation 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 Reservation resource accepts the following input properties:

SpecificReservation This property is required. ReservationSpecificReservation
Reservation for instances with specific machine shapes. Structure is documented below.
Zone
This property is required.
Changes to this property will trigger replacement.
string
The zone where the reservation is made.
Description Changes to this property will trigger replacement. string
An optional description of this resource.
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
ShareSettings ReservationShareSettings
The share setting for reservations.
SpecificReservationRequired Changes to this property will trigger replacement. bool
When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
SpecificReservation This property is required. ReservationSpecificReservationArgs
Reservation for instances with specific machine shapes. Structure is documented below.
Zone
This property is required.
Changes to this property will trigger replacement.
string
The zone where the reservation is made.
Description Changes to this property will trigger replacement. string
An optional description of this resource.
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
ShareSettings ReservationShareSettingsArgs
The share setting for reservations.
SpecificReservationRequired Changes to this property will trigger replacement. bool
When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
specificReservation This property is required. ReservationSpecificReservation
Reservation for instances with specific machine shapes. Structure is documented below.
zone
This property is required.
Changes to this property will trigger replacement.
String
The zone where the reservation is made.
description Changes to this property will trigger replacement. String
An optional description of this resource.
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
shareSettings ReservationShareSettings
The share setting for reservations.
specificReservationRequired Changes to this property will trigger replacement. Boolean
When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
specificReservation This property is required. ReservationSpecificReservation
Reservation for instances with specific machine shapes. Structure is documented below.
zone
This property is required.
Changes to this property will trigger replacement.
string
The zone where the reservation is made.
description Changes to this property will trigger replacement. string
An optional description of this resource.
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
shareSettings ReservationShareSettings
The share setting for reservations.
specificReservationRequired Changes to this property will trigger replacement. boolean
When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
specific_reservation This property is required. ReservationSpecificReservationArgs
Reservation for instances with specific machine shapes. Structure is documented below.
zone
This property is required.
Changes to this property will trigger replacement.
str
The zone where the reservation is made.
description Changes to this property will trigger replacement. str
An optional description of this resource.
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
share_settings ReservationShareSettingsArgs
The share setting for reservations.
specific_reservation_required Changes to this property will trigger replacement. bool
When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
specificReservation This property is required. Property Map
Reservation for instances with specific machine shapes. Structure is documented below.
zone
This property is required.
Changes to this property will trigger replacement.
String
The zone where the reservation is made.
description Changes to this property will trigger replacement. String
An optional description of this resource.
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
shareSettings Property Map
The share setting for reservations.
specificReservationRequired Changes to this property will trigger replacement. Boolean
When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.

Outputs

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

Commitment string
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Id string
The provider-assigned unique ID for this managed resource.
SelfLink string
The URI of the created resource.
Status string
The status of the reservation.
Commitment string
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Id string
The provider-assigned unique ID for this managed resource.
SelfLink string
The URI of the created resource.
Status string
The status of the reservation.
commitment String
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
creationTimestamp String
Creation timestamp in RFC3339 text format.
id String
The provider-assigned unique ID for this managed resource.
selfLink String
The URI of the created resource.
status String
The status of the reservation.
commitment string
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
creationTimestamp string
Creation timestamp in RFC3339 text format.
id string
The provider-assigned unique ID for this managed resource.
selfLink string
The URI of the created resource.
status string
The status of the reservation.
commitment str
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
creation_timestamp str
Creation timestamp in RFC3339 text format.
id str
The provider-assigned unique ID for this managed resource.
self_link str
The URI of the created resource.
status str
The status of the reservation.
commitment String
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
creationTimestamp String
Creation timestamp in RFC3339 text format.
id String
The provider-assigned unique ID for this managed resource.
selfLink String
The URI of the created resource.
status String
The status of the reservation.

Look up Existing Reservation Resource

Get an existing Reservation 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?: ReservationState, opts?: CustomResourceOptions): Reservation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        commitment: Optional[str] = None,
        creation_timestamp: Optional[str] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        self_link: Optional[str] = None,
        share_settings: Optional[ReservationShareSettingsArgs] = None,
        specific_reservation: Optional[ReservationSpecificReservationArgs] = None,
        specific_reservation_required: Optional[bool] = None,
        status: Optional[str] = None,
        zone: Optional[str] = None) -> Reservation
func GetReservation(ctx *Context, name string, id IDInput, state *ReservationState, opts ...ResourceOption) (*Reservation, error)
public static Reservation Get(string name, Input<string> id, ReservationState? state, CustomResourceOptions? opts = null)
public static Reservation get(String name, Output<String> id, ReservationState state, CustomResourceOptions options)
resources:  _:    type: gcp:compute:Reservation    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:
Commitment string
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Description Changes to this property will trigger replacement. string
An optional description of this resource.
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
SelfLink string
The URI of the created resource.
ShareSettings ReservationShareSettings
The share setting for reservations.
SpecificReservation ReservationSpecificReservation
Reservation for instances with specific machine shapes. Structure is documented below.
SpecificReservationRequired Changes to this property will trigger replacement. bool
When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
Status string
The status of the reservation.
Zone Changes to this property will trigger replacement. string
The zone where the reservation is made.
Commitment string
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Description Changes to this property will trigger replacement. string
An optional description of this resource.
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
SelfLink string
The URI of the created resource.
ShareSettings ReservationShareSettingsArgs
The share setting for reservations.
SpecificReservation ReservationSpecificReservationArgs
Reservation for instances with specific machine shapes. Structure is documented below.
SpecificReservationRequired Changes to this property will trigger replacement. bool
When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
Status string
The status of the reservation.
Zone Changes to this property will trigger replacement. string
The zone where the reservation is made.
commitment String
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
creationTimestamp String
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. String
An optional description of this resource.
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
selfLink String
The URI of the created resource.
shareSettings ReservationShareSettings
The share setting for reservations.
specificReservation ReservationSpecificReservation
Reservation for instances with specific machine shapes. Structure is documented below.
specificReservationRequired Changes to this property will trigger replacement. Boolean
When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
status String
The status of the reservation.
zone Changes to this property will trigger replacement. String
The zone where the reservation is made.
commitment string
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
creationTimestamp string
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. string
An optional description of this resource.
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
selfLink string
The URI of the created resource.
shareSettings ReservationShareSettings
The share setting for reservations.
specificReservation ReservationSpecificReservation
Reservation for instances with specific machine shapes. Structure is documented below.
specificReservationRequired Changes to this property will trigger replacement. boolean
When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
status string
The status of the reservation.
zone Changes to this property will trigger replacement. string
The zone where the reservation is made.
commitment str
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
creation_timestamp str
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. str
An optional description of this resource.
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
self_link str
The URI of the created resource.
share_settings ReservationShareSettingsArgs
The share setting for reservations.
specific_reservation ReservationSpecificReservationArgs
Reservation for instances with specific machine shapes. Structure is documented below.
specific_reservation_required Changes to this property will trigger replacement. bool
When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
status str
The status of the reservation.
zone Changes to this property will trigger replacement. str
The zone where the reservation is made.
commitment String
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
creationTimestamp String
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. String
An optional description of this resource.
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
selfLink String
The URI of the created resource.
shareSettings Property Map
The share setting for reservations.
specificReservation Property Map
Reservation for instances with specific machine shapes. Structure is documented below.
specificReservationRequired Changes to this property will trigger replacement. Boolean
When set to true, only VMs that target this reservation by name can consume this reservation. Otherwise, it can be consumed by VMs with affinity for any reservation. Defaults to false.
status String
The status of the reservation.
zone Changes to this property will trigger replacement. String
The zone where the reservation is made.

Supporting Types

ReservationShareSettings
, ReservationShareSettingsArgs

ProjectMaps List<ReservationShareSettingsProjectMap>
A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS. Structure is documented below.
ShareType Changes to this property will trigger replacement. string
Type of sharing for this shared-reservation Possible values are: LOCAL, SPECIFIC_PROJECTS.
ProjectMaps []ReservationShareSettingsProjectMap
A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS. Structure is documented below.
ShareType Changes to this property will trigger replacement. string
Type of sharing for this shared-reservation Possible values are: LOCAL, SPECIFIC_PROJECTS.
projectMaps List<ReservationShareSettingsProjectMap>
A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS. Structure is documented below.
shareType Changes to this property will trigger replacement. String
Type of sharing for this shared-reservation Possible values are: LOCAL, SPECIFIC_PROJECTS.
projectMaps ReservationShareSettingsProjectMap[]
A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS. Structure is documented below.
shareType Changes to this property will trigger replacement. string
Type of sharing for this shared-reservation Possible values are: LOCAL, SPECIFIC_PROJECTS.
project_maps Sequence[ReservationShareSettingsProjectMap]
A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS. Structure is documented below.
share_type Changes to this property will trigger replacement. str
Type of sharing for this shared-reservation Possible values are: LOCAL, SPECIFIC_PROJECTS.
projectMaps List<Property Map>
A map of project number and project config. This is only valid when shareType's value is SPECIFIC_PROJECTS. Structure is documented below.
shareType Changes to this property will trigger replacement. String
Type of sharing for this shared-reservation Possible values are: LOCAL, SPECIFIC_PROJECTS.

ReservationShareSettingsProjectMap
, ReservationShareSettingsProjectMapArgs

Id This property is required. string
The identifier for this object. Format specified above.
ProjectId string
The project id/number, should be same as the key of this project config in the project map.
Id This property is required. string
The identifier for this object. Format specified above.
ProjectId string
The project id/number, should be same as the key of this project config in the project map.
id This property is required. String
The identifier for this object. Format specified above.
projectId String
The project id/number, should be same as the key of this project config in the project map.
id This property is required. string
The identifier for this object. Format specified above.
projectId string
The project id/number, should be same as the key of this project config in the project map.
id This property is required. str
The identifier for this object. Format specified above.
project_id str
The project id/number, should be same as the key of this project config in the project map.
id This property is required. String
The identifier for this object. Format specified above.
projectId String
The project id/number, should be same as the key of this project config in the project map.

ReservationSpecificReservation
, ReservationSpecificReservationArgs

Count This property is required. int
The number of resources that are allocated.
InstanceProperties
This property is required.
Changes to this property will trigger replacement.
ReservationSpecificReservationInstanceProperties
The instance properties for the reservation. Structure is documented below.
InUseCount int
(Output) How many instances are in use.
Count This property is required. int
The number of resources that are allocated.
InstanceProperties
This property is required.
Changes to this property will trigger replacement.
ReservationSpecificReservationInstanceProperties
The instance properties for the reservation. Structure is documented below.
InUseCount int
(Output) How many instances are in use.
count This property is required. Integer
The number of resources that are allocated.
instanceProperties
This property is required.
Changes to this property will trigger replacement.
ReservationSpecificReservationInstanceProperties
The instance properties for the reservation. Structure is documented below.
inUseCount Integer
(Output) How many instances are in use.
count This property is required. number
The number of resources that are allocated.
instanceProperties
This property is required.
Changes to this property will trigger replacement.
ReservationSpecificReservationInstanceProperties
The instance properties for the reservation. Structure is documented below.
inUseCount number
(Output) How many instances are in use.
count This property is required. int
The number of resources that are allocated.
instance_properties
This property is required.
Changes to this property will trigger replacement.
ReservationSpecificReservationInstanceProperties
The instance properties for the reservation. Structure is documented below.
in_use_count int
(Output) How many instances are in use.
count This property is required. Number
The number of resources that are allocated.
instanceProperties
This property is required.
Changes to this property will trigger replacement.
Property Map
The instance properties for the reservation. Structure is documented below.
inUseCount Number
(Output) How many instances are in use.

ReservationSpecificReservationInstanceProperties
, ReservationSpecificReservationInstancePropertiesArgs

MachineType
This property is required.
Changes to this property will trigger replacement.
string
The name of the machine type to reserve.
GuestAccelerators Changes to this property will trigger replacement. List<ReservationSpecificReservationInstancePropertiesGuestAccelerator>
Guest accelerator type and count. Structure is documented below.
LocalSsds Changes to this property will trigger replacement. List<ReservationSpecificReservationInstancePropertiesLocalSsd>
The amount of local ssd to reserve with each instance. This reserves disks of type local-ssd. Structure is documented below.
MinCpuPlatform Changes to this property will trigger replacement. string
The minimum CPU platform for the reservation. For example, "Intel Skylake". See the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) for information on available CPU platforms.
MachineType
This property is required.
Changes to this property will trigger replacement.
string
The name of the machine type to reserve.
GuestAccelerators Changes to this property will trigger replacement. []ReservationSpecificReservationInstancePropertiesGuestAccelerator
Guest accelerator type and count. Structure is documented below.
LocalSsds Changes to this property will trigger replacement. []ReservationSpecificReservationInstancePropertiesLocalSsd
The amount of local ssd to reserve with each instance. This reserves disks of type local-ssd. Structure is documented below.
MinCpuPlatform Changes to this property will trigger replacement. string
The minimum CPU platform for the reservation. For example, "Intel Skylake". See the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) for information on available CPU platforms.
machineType
This property is required.
Changes to this property will trigger replacement.
String
The name of the machine type to reserve.
guestAccelerators Changes to this property will trigger replacement. List<ReservationSpecificReservationInstancePropertiesGuestAccelerator>
Guest accelerator type and count. Structure is documented below.
localSsds Changes to this property will trigger replacement. List<ReservationSpecificReservationInstancePropertiesLocalSsd>
The amount of local ssd to reserve with each instance. This reserves disks of type local-ssd. Structure is documented below.
minCpuPlatform Changes to this property will trigger replacement. String
The minimum CPU platform for the reservation. For example, "Intel Skylake". See the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) for information on available CPU platforms.
machineType
This property is required.
Changes to this property will trigger replacement.
string
The name of the machine type to reserve.
guestAccelerators Changes to this property will trigger replacement. ReservationSpecificReservationInstancePropertiesGuestAccelerator[]
Guest accelerator type and count. Structure is documented below.
localSsds Changes to this property will trigger replacement. ReservationSpecificReservationInstancePropertiesLocalSsd[]
The amount of local ssd to reserve with each instance. This reserves disks of type local-ssd. Structure is documented below.
minCpuPlatform Changes to this property will trigger replacement. string
The minimum CPU platform for the reservation. For example, "Intel Skylake". See the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) for information on available CPU platforms.
machine_type
This property is required.
Changes to this property will trigger replacement.
str
The name of the machine type to reserve.
guest_accelerators Changes to this property will trigger replacement. Sequence[ReservationSpecificReservationInstancePropertiesGuestAccelerator]
Guest accelerator type and count. Structure is documented below.
local_ssds Changes to this property will trigger replacement. Sequence[ReservationSpecificReservationInstancePropertiesLocalSsd]
The amount of local ssd to reserve with each instance. This reserves disks of type local-ssd. Structure is documented below.
min_cpu_platform Changes to this property will trigger replacement. str
The minimum CPU platform for the reservation. For example, "Intel Skylake". See the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) for information on available CPU platforms.
machineType
This property is required.
Changes to this property will trigger replacement.
String
The name of the machine type to reserve.
guestAccelerators Changes to this property will trigger replacement. List<Property Map>
Guest accelerator type and count. Structure is documented below.
localSsds Changes to this property will trigger replacement. List<Property Map>
The amount of local ssd to reserve with each instance. This reserves disks of type local-ssd. Structure is documented below.
minCpuPlatform Changes to this property will trigger replacement. String
The minimum CPU platform for the reservation. For example, "Intel Skylake". See the CPU platform availability reference](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#availablezones) for information on available CPU platforms.

ReservationSpecificReservationInstancePropertiesGuestAccelerator
, ReservationSpecificReservationInstancePropertiesGuestAcceleratorArgs

AcceleratorCount
This property is required.
Changes to this property will trigger replacement.
int
The number of the guest accelerator cards exposed to this instance.
AcceleratorType
This property is required.
Changes to this property will trigger replacement.
string
The full or partial URL of the accelerator type to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name.
AcceleratorCount
This property is required.
Changes to this property will trigger replacement.
int
The number of the guest accelerator cards exposed to this instance.
AcceleratorType
This property is required.
Changes to this property will trigger replacement.
string
The full or partial URL of the accelerator type to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name.
acceleratorCount
This property is required.
Changes to this property will trigger replacement.
Integer
The number of the guest accelerator cards exposed to this instance.
acceleratorType
This property is required.
Changes to this property will trigger replacement.
String
The full or partial URL of the accelerator type to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name.
acceleratorCount
This property is required.
Changes to this property will trigger replacement.
number
The number of the guest accelerator cards exposed to this instance.
acceleratorType
This property is required.
Changes to this property will trigger replacement.
string
The full or partial URL of the accelerator type to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name.
accelerator_count
This property is required.
Changes to this property will trigger replacement.
int
The number of the guest accelerator cards exposed to this instance.
accelerator_type
This property is required.
Changes to this property will trigger replacement.
str
The full or partial URL of the accelerator type to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name.
acceleratorCount
This property is required.
Changes to this property will trigger replacement.
Number
The number of the guest accelerator cards exposed to this instance.
acceleratorType
This property is required.
Changes to this property will trigger replacement.
String
The full or partial URL of the accelerator type to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name.

ReservationSpecificReservationInstancePropertiesLocalSsd
, ReservationSpecificReservationInstancePropertiesLocalSsdArgs

DiskSizeGb
This property is required.
Changes to this property will trigger replacement.
int
The size of the disk in base-2 GB.


Interface Changes to this property will trigger replacement. string
The disk interface to use for attaching this disk. Default value is SCSI. Possible values are: SCSI, NVME.
DiskSizeGb
This property is required.
Changes to this property will trigger replacement.
int
The size of the disk in base-2 GB.


Interface Changes to this property will trigger replacement. string
The disk interface to use for attaching this disk. Default value is SCSI. Possible values are: SCSI, NVME.
diskSizeGb
This property is required.
Changes to this property will trigger replacement.
Integer
The size of the disk in base-2 GB.


interface_ Changes to this property will trigger replacement. String
The disk interface to use for attaching this disk. Default value is SCSI. Possible values are: SCSI, NVME.
diskSizeGb
This property is required.
Changes to this property will trigger replacement.
number
The size of the disk in base-2 GB.


interface Changes to this property will trigger replacement. string
The disk interface to use for attaching this disk. Default value is SCSI. Possible values are: SCSI, NVME.
disk_size_gb
This property is required.
Changes to this property will trigger replacement.
int
The size of the disk in base-2 GB.


interface Changes to this property will trigger replacement. str
The disk interface to use for attaching this disk. Default value is SCSI. Possible values are: SCSI, NVME.
diskSizeGb
This property is required.
Changes to this property will trigger replacement.
Number
The size of the disk in base-2 GB.


interface Changes to this property will trigger replacement. String
The disk interface to use for attaching this disk. Default value is SCSI. Possible values are: SCSI, NVME.

Import

Reservation can be imported using any of these accepted formats:

  • projects/{{project}}/zones/{{zone}}/reservations/{{name}}

  • {{project}}/{{zone}}/{{name}}

  • {{zone}}/{{name}}

  • {{name}}

When using the pulumi import command, Reservation can be imported using one of the formats above. For example:

$ pulumi import gcp:compute/reservation:Reservation default projects/{{project}}/zones/{{zone}}/reservations/{{name}}
Copy
$ pulumi import gcp:compute/reservation:Reservation default {{project}}/{{zone}}/{{name}}
Copy
$ pulumi import gcp:compute/reservation:Reservation default {{zone}}/{{name}}
Copy
$ pulumi import gcp:compute/reservation:Reservation 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.