UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

190 lines • 9.15 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.FutureReservation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * ## Example Usage * * ### Future Reservation Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const gceFutureReservation = new gcp.compute.FutureReservation("gce_future_reservation", { * name: "gce-future-reservation", * project: "my-project-name", * autoDeleteAutoCreatedReservations: true, * planningStatus: "DRAFT", * namePrefix: "fr-basic", * timeWindow: { * startTime: "2025-11-01T00:00:00Z", * endTime: "2025-11-02T00:00:00Z", * }, * specificSkuProperties: { * totalCount: "1", * instanceProperties: { * machineType: "e2-standard-2", * }, * }, * }); * ``` * ### Future Reservation Aggregate Reservation * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const gceFutureReservation = new gcp.compute.FutureReservation("gce_future_reservation", { * name: "gce-future-reservation-aggregate-reservation", * project: "my-project-name", * autoDeleteAutoCreatedReservations: true, * planningStatus: "DRAFT", * namePrefix: "fr-basic", * timeWindow: { * startTime: "2025-11-01T00:00:00Z", * endTime: "2025-11-02T00:00:00Z", * }, * aggregateReservation: { * vmFamily: "VM_FAMILY_CLOUD_TPU_DEVICE_CT3", * workloadType: "UNSPECIFIED", * reservedResources: [ * { * accelerator: { * acceleratorCount: 32, * acceleratorType: "projects/my-project-name/zones/us-central1-a/acceleratorTypes/ct3", * }, * }, * { * accelerator: { * acceleratorCount: 2, * acceleratorType: "projects/my-project-name/zones/us-central1-a/acceleratorTypes/ct3", * }, * }, * ], * }, * }); * ``` * * ## Import * * FutureReservation can be imported using any of these accepted formats: * * * `projects/{{project}}/zones/{{zone}}/futureReservations/{{name}}` * * * `{{project}}/{{zone}}/{{name}}` * * * `{{zone}}/{{name}}` * * * `{{name}}` * * When using the `pulumi import` command, FutureReservation can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/futureReservation:FutureReservation default projects/{{project}}/zones/{{zone}}/futureReservations/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/futureReservation:FutureReservation default {{project}}/{{zone}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/futureReservation:FutureReservation default {{zone}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/futureReservation:FutureReservation default {{name}} * ``` */ class FutureReservation extends pulumi.CustomResource { /** * Get an existing FutureReservation 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, id, state, opts) { return new FutureReservation(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of FutureReservation. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === FutureReservation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["aggregateReservation"] = state ? state.aggregateReservation : undefined; resourceInputs["autoCreatedReservationsDeleteTime"] = state ? state.autoCreatedReservationsDeleteTime : undefined; resourceInputs["autoCreatedReservationsDuration"] = state ? state.autoCreatedReservationsDuration : undefined; resourceInputs["autoDeleteAutoCreatedReservations"] = state ? state.autoDeleteAutoCreatedReservations : undefined; resourceInputs["commitmentInfo"] = state ? state.commitmentInfo : undefined; resourceInputs["creationTimestamp"] = state ? state.creationTimestamp : undefined; resourceInputs["deploymentType"] = state ? state.deploymentType : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["namePrefix"] = state ? state.namePrefix : undefined; resourceInputs["planningStatus"] = state ? state.planningStatus : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["reservationMode"] = state ? state.reservationMode : undefined; resourceInputs["reservationName"] = state ? state.reservationName : undefined; resourceInputs["schedulingType"] = state ? state.schedulingType : undefined; resourceInputs["selfLink"] = state ? state.selfLink : undefined; resourceInputs["selfLinkWithId"] = state ? state.selfLinkWithId : undefined; resourceInputs["shareSettings"] = state ? state.shareSettings : undefined; resourceInputs["specificReservationRequired"] = state ? state.specificReservationRequired : undefined; resourceInputs["specificSkuProperties"] = state ? state.specificSkuProperties : undefined; resourceInputs["statuses"] = state ? state.statuses : undefined; resourceInputs["timeWindow"] = state ? state.timeWindow : undefined; resourceInputs["zone"] = state ? state.zone : undefined; } else { const args = argsOrState; if ((!args || args.timeWindow === undefined) && !opts.urn) { throw new Error("Missing required property 'timeWindow'"); } resourceInputs["aggregateReservation"] = args ? args.aggregateReservation : undefined; resourceInputs["autoCreatedReservationsDeleteTime"] = args ? args.autoCreatedReservationsDeleteTime : undefined; resourceInputs["autoCreatedReservationsDuration"] = args ? args.autoCreatedReservationsDuration : undefined; resourceInputs["autoDeleteAutoCreatedReservations"] = args ? args.autoDeleteAutoCreatedReservations : undefined; resourceInputs["commitmentInfo"] = args ? args.commitmentInfo : undefined; resourceInputs["deploymentType"] = args ? args.deploymentType : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["namePrefix"] = args ? args.namePrefix : undefined; resourceInputs["planningStatus"] = args ? args.planningStatus : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["reservationMode"] = args ? args.reservationMode : undefined; resourceInputs["reservationName"] = args ? args.reservationName : undefined; resourceInputs["schedulingType"] = args ? args.schedulingType : undefined; resourceInputs["shareSettings"] = args ? args.shareSettings : undefined; resourceInputs["specificReservationRequired"] = args ? args.specificReservationRequired : undefined; resourceInputs["specificSkuProperties"] = args ? args.specificSkuProperties : undefined; resourceInputs["timeWindow"] = args ? args.timeWindow : undefined; resourceInputs["creationTimestamp"] = undefined /*out*/; resourceInputs["selfLink"] = undefined /*out*/; resourceInputs["selfLinkWithId"] = undefined /*out*/; resourceInputs["statuses"] = undefined /*out*/; resourceInputs["zone"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FutureReservation.__pulumiType, name, resourceInputs, opts); } } exports.FutureReservation = FutureReservation; /** @internal */ FutureReservation.__pulumiType = 'gcp:compute/futureReservation:FutureReservation'; //# sourceMappingURL=futureReservation.js.map