@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
183 lines • 7.82 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResizeRequest = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Represents a Managed Instance Group Resize Request
*
* Resize Requests are the Managed Instance Group implementation of Dynamic Workload Scheduler Flex Start.
*
* With Dynamic Workload Scheduler in Flex Start mode, you submit a GPU capacity request for your AI/ML jobs by indicating how many you need, a duration, and your preferred zone. Dynamic Workload Scheduler intelligently persists the request; once the capacity becomes available, it automatically provisions your VMs enabling your workloads to run continuously for the entire duration of the capacity allocation.
*
* To get more information about ResizeRequest, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/instanceGroupManagerResizeRequests)
* * How-to Guides
* * [About resize requests in a MIG](https://cloud.google.com/compute/docs/instance-groups/about-resize-requests-mig)
*
* ## Example Usage
*
* ### Compute Mig Resize Request
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const a3Dws = new gcp.compute.RegionInstanceTemplate("a3_dws", {
* name: "a3-dws",
* region: "us-central1",
* description: "This template is used to create a mig instance that is compatible with DWS resize requests.",
* instanceDescription: "A3 GPU",
* machineType: "a3-highgpu-8g",
* canIpForward: false,
* scheduling: {
* automaticRestart: false,
* onHostMaintenance: "TERMINATE",
* },
* disks: [{
* sourceImage: "cos-cloud/cos-105-lts",
* autoDelete: true,
* boot: true,
* diskType: "pd-ssd",
* diskSizeGb: 960,
* mode: "READ_WRITE",
* }],
* guestAccelerators: [{
* type: "nvidia-h100-80gb",
* count: 8,
* }],
* reservationAffinity: {
* type: "NO_RESERVATION",
* },
* shieldedInstanceConfig: {
* enableVtpm: true,
* enableIntegrityMonitoring: true,
* },
* networkInterfaces: [{
* network: "default",
* }],
* });
* const a3DwsInstanceGroupManager = new gcp.compute.InstanceGroupManager("a3_dws", {
* name: "a3-dws",
* baseInstanceName: "a3-dws",
* zone: "us-central1-a",
* versions: [{
* instanceTemplate: a3Dws.selfLink,
* }],
* instanceLifecyclePolicy: {
* defaultActionOnFailure: "DO_NOTHING",
* },
* waitForInstances: false,
* });
* const a3ResizeRequest = new gcp.compute.ResizeRequest("a3_resize_request", {
* name: "a3-dws",
* instanceGroupManager: a3DwsInstanceGroupManager.name,
* zone: "us-central1-a",
* description: "Test resize request resource",
* resizeBy: 2,
* requestedRunDuration: {
* seconds: "14400",
* nanos: 0,
* },
* });
* ```
*
* ## Import
*
* ResizeRequest can be imported using any of these accepted formats:
*
* * `projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{instance_group_manager}}/resizeRequests/{{name}}`
*
* * `{{project}}/{{zone}}/{{instance_group_manager}}/{{name}}`
*
* * `{{zone}}/{{instance_group_manager}}/{{name}}`
*
* * `{{instance_group_manager}}/{{name}}`
*
* When using the `pulumi import` command, ResizeRequest can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/resizeRequest:ResizeRequest default projects/{{project}}/zones/{{zone}}/instanceGroupManagers/{{instance_group_manager}}/resizeRequests/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/resizeRequest:ResizeRequest default {{project}}/{{zone}}/{{instance_group_manager}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/resizeRequest:ResizeRequest default {{zone}}/{{instance_group_manager}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/resizeRequest:ResizeRequest default {{instance_group_manager}}/{{name}}
* ```
*/
class ResizeRequest extends pulumi.CustomResource {
/**
* Get an existing ResizeRequest 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 ResizeRequest(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ResizeRequest. 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'] === ResizeRequest.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["creationTimestamp"] = state ? state.creationTimestamp : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["instanceGroupManager"] = state ? state.instanceGroupManager : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["requestedRunDuration"] = state ? state.requestedRunDuration : undefined;
resourceInputs["resizeBy"] = state ? state.resizeBy : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["statuses"] = state ? state.statuses : undefined;
resourceInputs["zone"] = state ? state.zone : undefined;
}
else {
const args = argsOrState;
if ((!args || args.instanceGroupManager === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceGroupManager'");
}
if ((!args || args.resizeBy === undefined) && !opts.urn) {
throw new Error("Missing required property 'resizeBy'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["instanceGroupManager"] = args ? args.instanceGroupManager : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["requestedRunDuration"] = args ? args.requestedRunDuration : undefined;
resourceInputs["resizeBy"] = args ? args.resizeBy : undefined;
resourceInputs["zone"] = args ? args.zone : undefined;
resourceInputs["creationTimestamp"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["statuses"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ResizeRequest.__pulumiType, name, resourceInputs, opts);
}
}
exports.ResizeRequest = ResizeRequest;
/** @internal */
ResizeRequest.__pulumiType = 'gcp:compute/resizeRequest:ResizeRequest';
//# sourceMappingURL=resizeRequest.js.map