ReservationArgs

data class ReservationArgs(val description: Output<String>? = null, val name: Output<String>? = null, val project: Output<String>? = null, val shareSettings: Output<ReservationShareSettingsArgs>? = null, val specificReservation: Output<ReservationSpecificReservationArgs>? = null, val specificReservationRequired: Output<Boolean>? = null, val zone: Output<String>? = null) : ConvertibleToJava<ReservationArgs>

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

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()
.specificReservation(ReservationSpecificReservationArgs.builder()
.count(1)
.instanceProperties(ReservationSpecificReservationInstancePropertiesArgs.builder()
.machineType("n2-standard-2")
.minCpuPlatform("Intel Cascade Lake")
.build())
.build())
.zone("us-central1-a")
.build());
}
}

Import

Reservation can be imported using any of these accepted formats

$ 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}}

Constructors

Link copied to clipboard
constructor(description: Output<String>? = null, name: Output<String>? = null, project: Output<String>? = null, shareSettings: Output<ReservationShareSettingsArgs>? = null, specificReservation: Output<ReservationSpecificReservationArgs>? = null, specificReservationRequired: Output<Boolean>? = null, zone: Output<String>? = null)

Properties

Link copied to clipboard
val description: Output<String>? = null

An optional description of this resource.

Link copied to clipboard
val name: Output<String>? = null

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.

Link copied to clipboard
val project: Output<String>? = null

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

Link copied to clipboard

The share setting for reservations. Structure is documented below.

Link copied to clipboard

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

Link copied to clipboard

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.

Link copied to clipboard
val zone: Output<String>? = null

The zone where the reservation is made.

Functions

Link copied to clipboard
open override fun toJava(): ReservationArgs