pulumi_wasm_providers_gcp_mini::compute

Module reservation

source
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:

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

Functions§

  • Registers a new resource with the given unique name and arguments