Class 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:
- API documentation
- How-to Guides
- Reserving zonal resources
Example Usage - Reservation Basic
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var gceReservation = new Gcp.Compute.Reservation("gceReservation", new Gcp.Compute.ReservationArgs
{
SpecificReservation = new Gcp.Compute.Inputs.ReservationSpecificReservationArgs
{
Count = 1,
InstanceProperties = new Gcp.Compute.Inputs.ReservationSpecificReservationInstancePropertiesArgs
{
MachineType = "n2-standard-2",
MinCpuPlatform = "Intel Cascade Lake",
},
},
Zone = "us-central1-a",
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.Compute
Assembly: Pulumi.Gcp.dll
Syntax
public class Reservation : CustomResource
Constructors
View SourceReservation(String, ReservationArgs, CustomResourceOptions)
Create a Reservation resource with the given unique name, arguments, and options.
Declaration
public Reservation(string name, ReservationArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ReservationArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCommitment
Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
Declaration
public Output<string> Commitment { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CreationTimestamp
Creation timestamp in RFC3339 text format.
Declaration
public Output<string> CreationTimestamp { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
An optional description of this resource.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
Name of the resource. Provided by the client when the resource is
created. The name must be 1-63 characters long, and comply with
RFC1035. Specifically, the name must be 1-63 characters long and match
the regular expression a-z? which means the
first character must be a lowercase letter, and all following
characters must be a dash, lowercase letter, or digit, except the last
character, which cannot be a dash.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Project
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SelfLink
The URI of the created resource.
Declaration
public Output<string> SelfLink { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SpecificReservation
Reservation for instances with specific machine shapes. Structure is documented below.
Declaration
public Output<ReservationSpecificReservation> SpecificReservation { get; }
Property Value
| Type | Description |
|---|---|
| Output<ReservationSpecificReservation> |
SpecificReservationRequired
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.
Declaration
public Output<bool?> SpecificReservationRequired { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Status
The status of the reservation.
Declaration
public Output<string> Status { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Zone
The zone where the reservation is made.
Declaration
public Output<string> Zone { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, ReservationState, CustomResourceOptions)
Get an existing Reservation resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Reservation Get(string name, Input<string> id, ReservationState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ReservationState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Reservation |