Expand description
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
§Example Usage
§Reservation Basic
ⓘ
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let gceReservation = reservation::create(
"gceReservation",
ReservationArgs::builder()
.name("gce-reservation")
.specific_reservation(
ReservationSpecificReservation::builder()
.count(1)
.instanceProperties(
ReservationSpecificReservationInstanceProperties::builder()
.machineType("n2-standard-2")
.minCpuPlatform("Intel Cascade Lake")
.build_struct(),
)
.build_struct(),
)
.zone("us-central1-a")
.build_struct(),
);
}
§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}}
$ pulumi import gcp:compute/reservation:Reservation default {{project}}/{{zone}}/{{name}}
$ pulumi import gcp:compute/reservation:Reservation default {{zone}}/{{name}}
$ pulumi import gcp:compute/reservation:Reservation default {{name}}
Structs§
- Use builder syntax to set the inputs and finish with
build_struct()
.
Functions§
- Registers a new resource with the given unique name and arguments