@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
239 lines (238 loc) • 8.87 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* 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](https://cloud.google.com/compute/docs/reference/rest/v1/reservations)
* * How-to Guides
* * [Reserving zonal resources](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
*
* ## Example Usage
*
* ### Reservation Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const gceReservation = new gcp.compute.Reservation("gce_reservation", {
* name: "gce-reservation",
* zone: "us-central1-a",
* specificReservation: {
* count: 1,
* instanceProperties: {
* minCpuPlatform: "Intel Cascade Lake",
* machineType: "n2-standard-2",
* },
* },
* });
* ```
*
* ## 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:
*
* ```sh
* $ pulumi import gcp:compute/reservation:Reservation default projects/{{project}}/zones/{{zone}}/reservations/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/reservation:Reservation default {{project}}/{{zone}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/reservation:Reservation default {{zone}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/reservation:Reservation default {{name}}
* ```
*/
export declare class Reservation extends pulumi.CustomResource {
/**
* Get an existing Reservation resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ReservationState, opts?: pulumi.CustomResourceOptions): Reservation;
/**
* Returns true if the given object is an instance of Reservation. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Reservation;
/**
* Full or partial URL to a parent commitment. This field displays for
* reservations that are tied to a commitment.
*/
readonly commitment: pulumi.Output<string>;
/**
* Creation timestamp in RFC3339 text format.
*/
readonly creationTimestamp: pulumi.Output<string>;
/**
* An optional description of this resource.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* 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.
*/
readonly name: pulumi.Output<string>;
readonly project: pulumi.Output<string>;
/**
* The URI of the created resource.
*/
readonly selfLink: pulumi.Output<string>;
/**
* The share setting for reservations.
*/
readonly shareSettings: pulumi.Output<outputs.compute.ReservationShareSettings>;
/**
* Reservation for instances with specific machine shapes.
* Structure is documented below.
*/
readonly specificReservation: pulumi.Output<outputs.compute.ReservationSpecificReservation>;
/**
* 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.
*/
readonly specificReservationRequired: pulumi.Output<boolean | undefined>;
/**
* The status of the reservation.
*/
readonly status: pulumi.Output<string>;
/**
* The zone where the reservation is made.
*/
readonly zone: pulumi.Output<string>;
/**
* Create a Reservation resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ReservationArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Reservation resources.
*/
export interface ReservationState {
/**
* Full or partial URL to a parent commitment. This field displays for
* reservations that are tied to a commitment.
*/
commitment?: pulumi.Input<string>;
/**
* Creation timestamp in RFC3339 text format.
*/
creationTimestamp?: pulumi.Input<string>;
/**
* An optional description of this resource.
*/
description?: pulumi.Input<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.
*/
name?: pulumi.Input<string>;
project?: pulumi.Input<string>;
/**
* The URI of the created resource.
*/
selfLink?: pulumi.Input<string>;
/**
* The share setting for reservations.
*/
shareSettings?: pulumi.Input<inputs.compute.ReservationShareSettings>;
/**
* Reservation for instances with specific machine shapes.
* Structure is documented below.
*/
specificReservation?: pulumi.Input<inputs.compute.ReservationSpecificReservation>;
/**
* 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.
*/
specificReservationRequired?: pulumi.Input<boolean>;
/**
* The status of the reservation.
*/
status?: pulumi.Input<string>;
/**
* The zone where the reservation is made.
*/
zone?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Reservation resource.
*/
export interface ReservationArgs {
/**
* An optional description of this resource.
*/
description?: pulumi.Input<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.
*/
name?: pulumi.Input<string>;
project?: pulumi.Input<string>;
/**
* The share setting for reservations.
*/
shareSettings?: pulumi.Input<inputs.compute.ReservationShareSettings>;
/**
* Reservation for instances with specific machine shapes.
* Structure is documented below.
*/
specificReservation: pulumi.Input<inputs.compute.ReservationSpecificReservation>;
/**
* 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.
*/
specificReservationRequired?: pulumi.Input<boolean>;
/**
* The zone where the reservation is made.
*/
zone: pulumi.Input<string>;
}