"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.RegionResizeRequest = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a Regional 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 region. 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 RegionResizeRequest, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/regionInstanceGroupManagerResizeRequests)
 * * How-to Guides
 *     * [About resize requests in a MIG](https://cloud.google.com/compute/docs/instance-groups/about-resize-requests-mig)
 *
 * ## Example Usage
 *
 * ### Compute Rmig 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-121-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 a3DwsRegionInstanceGroupManager = new gcp.compute.RegionInstanceGroupManager("a3_dws", {
 *     name: "a3-dws",
 *     baseInstanceName: "a3-dws",
 *     region: "us-central1",
 *     versions: [{
 *         instanceTemplate: a3Dws.selfLink,
 *     }],
 *     instanceLifecyclePolicy: {
 *         defaultActionOnFailure: "DO_NOTHING",
 *     },
 *     distributionPolicyTargetShape: "ANY_SINGLE_ZONE",
 *     distributionPolicyZones: [
 *         "us-central1-a",
 *         "us-central1-b",
 *         "us-central1-c",
 *         "us-central1-f",
 *     ],
 *     updatePolicy: {
 *         instanceRedistributionType: "NONE",
 *         type: "OPPORTUNISTIC",
 *         minimalAction: "REPLACE",
 *         maxSurgeFixed: 0,
 *         maxUnavailableFixed: 6,
 *     },
 *     waitForInstances: false,
 * });
 * const a3ResizeRequest = new gcp.compute.RegionResizeRequest("a3_resize_request", {
 *     name: "a3-dws",
 *     instanceGroupManager: a3DwsRegionInstanceGroupManager.name,
 *     region: "us-central1",
 *     description: "Test resize request resource",
 *     resizeBy: 2,
 *     requestedRunDuration: {
 *         seconds: "14400",
 *         nanos: 0,
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * RegionResizeRequest can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/regions/{{region}}/instanceGroupManagers/{{instance_group_manager}}/resizeRequests/{{name}}`
 *
 * * `{{project}}/{{region}}/{{instance_group_manager}}/{{name}}`
 *
 * * `{{region}}/{{instance_group_manager}}/{{name}}`
 *
 * * `{{instance_group_manager}}/{{name}}`
 *
 * When using the `pulumi import` command, RegionResizeRequest can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/regionResizeRequest:RegionResizeRequest default projects/{{project}}/regions/{{region}}/instanceGroupManagers/{{instance_group_manager}}/resizeRequests/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionResizeRequest:RegionResizeRequest default {{project}}/{{region}}/{{instance_group_manager}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionResizeRequest:RegionResizeRequest default {{region}}/{{instance_group_manager}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionResizeRequest:RegionResizeRequest default {{instance_group_manager}}/{{name}}
 * ```
 */
class RegionResizeRequest extends pulumi.CustomResource {
    /**
     * Get an existing RegionResizeRequest 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 RegionResizeRequest(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of RegionResizeRequest.  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'] === RegionResizeRequest.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["creationTimestamp"] = state?.creationTimestamp;
            resourceInputs["description"] = state?.description;
            resourceInputs["instanceGroupManager"] = state?.instanceGroupManager;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["region"] = state?.region;
            resourceInputs["requestedRunDuration"] = state?.requestedRunDuration;
            resourceInputs["resizeBy"] = state?.resizeBy;
            resourceInputs["state"] = state?.state;
            resourceInputs["statuses"] = state?.statuses;
        }
        else {
            const args = argsOrState;
            if (args?.instanceGroupManager === undefined && !opts.urn) {
                throw new Error("Missing required property 'instanceGroupManager'");
            }
            if (args?.resizeBy === undefined && !opts.urn) {
                throw new Error("Missing required property 'resizeBy'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["instanceGroupManager"] = args?.instanceGroupManager;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["requestedRunDuration"] = args?.requestedRunDuration;
            resourceInputs["resizeBy"] = args?.resizeBy;
            resourceInputs["creationTimestamp"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["statuses"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RegionResizeRequest.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RegionResizeRequest = RegionResizeRequest;
/** @internal */
RegionResizeRequest.__pulumiType = 'gcp:compute/regionResizeRequest:RegionResizeRequest';
//# sourceMappingURL=regionResizeRequest.js.map