Reservation

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:

Create a Reservation Resource

def Reservation(resource_name, opts=None, description=None, name=None, project=None, specific_reservation=None, specific_reservation_required=None, zone=None, __props__=None);
func NewReservation(ctx *Context, name string, args ReservationArgs, opts ...ResourceOption) (*Reservation, error)
public Reservation(string name, ReservationArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ReservationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ReservationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ReservationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Reservation Resource Properties

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

Inputs

The Reservation resource accepts the following input properties:

SpecificReservation ReservationSpecificReservationArgs

Reservation for instances with specific machine shapes. Structure is documented below.

Zone string

The zone where the reservation is made.

Description string

An optional description of this resource.

Name string

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

Project string

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

SpecificReservationRequired 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 ReservationSpecificReservation

Reservation for instances with specific machine shapes. Structure is documented below.

Zone string

The zone where the reservation is made.

Description string

An optional description of this resource.

Name string

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

Project string

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

SpecificReservationRequired 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 ReservationSpecificReservation

Reservation for instances with specific machine shapes. Structure is documented below.

zone string

The zone where the reservation is made.

description string

An optional description of this resource.

name string

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

project string

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

specificReservationRequired 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 Dict[ReservationSpecificReservation]

Reservation for instances with specific machine shapes. Structure is documented below.

zone str

The zone where the reservation is made.

description str

An optional description of this resource.

name str

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

project str

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

specific_reservation_required 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.

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 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.

Look up an 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
static get(resource_name, id, opts=None, commitment=None, creation_timestamp=None, description=None, name=None, project=None, self_link=None, specific_reservation=None, specific_reservation_required=None, status=None, zone=None, __props__=None);
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)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

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 string

An optional description of this resource.

Name string

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

Project string

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

SelfLink string

The URI of the created resource.

SpecificReservation ReservationSpecificReservationArgs

Reservation for instances with specific machine shapes. Structure is documented below.

SpecificReservationRequired 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 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 string

An optional description of this resource.

Name string

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

Project string

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

SelfLink string

The URI of the created resource.

SpecificReservation ReservationSpecificReservation

Reservation for instances with specific machine shapes. Structure is documented below.

SpecificReservationRequired 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 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 string

An optional description of this resource.

name string

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

project string

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

selfLink string

The URI of the created resource.

specificReservation ReservationSpecificReservation

Reservation for instances with specific machine shapes. Structure is documented below.

specificReservationRequired 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 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 str

An optional description of this resource.

name str

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

project str

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

self_link str

The URI of the created resource.

specific_reservation Dict[ReservationSpecificReservation]

Reservation for instances with specific machine shapes. Structure is documented below.

specific_reservation_required 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 str

The zone where the reservation is made.

Supporting Types

ReservationSpecificReservation

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Count int

The number of resources that are allocated.

InstanceProperties ReservationSpecificReservationInstancePropertiesArgs

The instance properties for the reservation. Structure is documented below.

InUseCount int

- How many instances are in use.

Count int

The number of resources that are allocated.

InstanceProperties ReservationSpecificReservationInstanceProperties

The instance properties for the reservation. Structure is documented below.

InUseCount int

- How many instances are in use.

count number

The number of resources that are allocated.

instanceProperties ReservationSpecificReservationInstanceProperties

The instance properties for the reservation. Structure is documented below.

inUseCount number

- How many instances are in use.

count float

The number of resources that are allocated.

instanceProperties Dict[ReservationSpecificReservationInstanceProperties]

The instance properties for the reservation. Structure is documented below.

inUseCount float

- How many instances are in use.

ReservationSpecificReservationInstanceProperties

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

MachineType string

The name of the machine type to reserve.

GuestAccelerators List<ReservationSpecificReservationInstancePropertiesGuestAcceleratorArgs>

Guest accelerator type and count. Structure is documented below.

LocalSsds List<ReservationSpecificReservationInstancePropertiesLocalSsdArgs>

The amount of local ssd to reserve with each instance. This reserves disks of type local-ssd. Structure is documented below.

MinCpuPlatform 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 string

The name of the machine type to reserve.

GuestAccelerators []ReservationSpecificReservationInstancePropertiesGuestAccelerator

Guest accelerator type and count. Structure is documented below.

LocalSsds []ReservationSpecificReservationInstancePropertiesLocalSsd

The amount of local ssd to reserve with each instance. This reserves disks of type local-ssd. Structure is documented below.

MinCpuPlatform 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 string

The name of the machine type to reserve.

guestAccelerators ReservationSpecificReservationInstancePropertiesGuestAccelerator[]

Guest accelerator type and count. Structure is documented below.

localSsds ReservationSpecificReservationInstancePropertiesLocalSsd[]

The amount of local ssd to reserve with each instance. This reserves disks of type local-ssd. Structure is documented below.

minCpuPlatform 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 str

The name of the machine type to reserve.

guest_accelerators List[ReservationSpecificReservationInstancePropertiesGuestAccelerator]

Guest accelerator type and count. Structure is documented below.

localSsds List[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 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.

ReservationSpecificReservationInstancePropertiesGuestAccelerator

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

AcceleratorCount int

The number of the guest accelerator cards exposed to this instance.

AcceleratorType 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 int

The number of the guest accelerator cards exposed to this instance.

AcceleratorType 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 number

The number of the guest accelerator cards exposed to this instance.

acceleratorType 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 float

The number of the guest accelerator cards exposed to this instance.

accelerator_type 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.

ReservationSpecificReservationInstancePropertiesLocalSsd

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

DiskSizeGb int

The size of the disk in base-2 GB.

Interface string

The disk interface to use for attaching this disk.

DiskSizeGb int

The size of the disk in base-2 GB.

Interface string

The disk interface to use for attaching this disk.

diskSizeGb number

The size of the disk in base-2 GB.

interface string

The disk interface to use for attaching this disk.

disk_size_gb float

The size of the disk in base-2 GB.

interface str

The disk interface to use for attaching this disk.

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.