"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.RestoreWorkload = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * An imperative resource that triggers a GCBDR restoration event.
 * Creating this resource will initiate a restore operation from a specified backup.
 * The resource represents the restore operation and its result.
 *
 * ## Example Usage
 *
 * ### Backup Dr Restore Workload Compute Instance Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const restoreComputeBasic = new gcp.backupdisasterrecovery.RestoreWorkload("restore_compute_basic", {
 *     location: "us-central1",
 *     backupVaultId: "backup-vault",
 *     dataSourceId: "data-source",
 *     backupId: "backup",
 *     name: "projects/my-project/locations/us-central1/backups/my-backup",
 *     computeInstanceTargetEnvironment: {
 *         project: "my-project-name",
 *         zone: "us-central1-a",
 *     },
 *     computeInstanceRestoreProperties: {
 *         name: "restored-instance",
 *         machineType: "e2-medium",
 *     },
 * });
 * ```
 * ### Backup Dr Restore Workload Compute Instance Full
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const restoreComputeFull = new gcp.backupdisasterrecovery.RestoreWorkload("restore_compute_full", {
 *     location: "us-central1",
 *     backupVaultId: "backup-vault",
 *     dataSourceId: "data-source",
 *     backupId: "backup",
 *     name: "projects/my-project/locations/us-central1/backups/my-backup",
 *     computeInstanceTargetEnvironment: {
 *         project: "my-project-name",
 *         zone: "us-central1-a",
 *     },
 *     computeInstanceRestoreProperties: {
 *         name: "restored-instance-full",
 *         machineType: "e2-medium",
 *         description: "Restored compute instance with advanced configuration",
 *         canIpForward: true,
 *         deletionProtection: false,
 *         labels: {
 *             environment: "production",
 *             restored: "true",
 *             team: "infrastructure",
 *         },
 *         tags: {
 *             items: [
 *                 "web",
 *                 "https-server",
 *                 "restored",
 *             ],
 *         },
 *         networkInterfaces: [{
 *             network: "default",
 *             subnetwork: "projects/my-project-name/regions/us-central1/subnetworks/default",
 *             accessConfigs: [{
 *                 name: "External NAT",
 *                 networkTier: "PREMIUM",
 *             }],
 *         }],
 *         scheduling: {
 *             automaticRestart: true,
 *             onHostMaintenance: "MIGRATE",
 *             preemptible: false,
 *             provisioningModel: "STANDARD",
 *         },
 *         serviceAccounts: [{
 *             email: "default",
 *             scopes: [
 *                 "https://www.googleapis.com/auth/cloud-platform",
 *                 "https://www.googleapis.com/auth/compute",
 *             ],
 *         }],
 *         shieldedInstanceConfig: {
 *             enableSecureBoot: true,
 *             enableVtpm: true,
 *             enableIntegrityMonitoring: true,
 *         },
 *         advancedMachineFeatures: {
 *             enableNestedVirtualization: false,
 *             threadsPerCore: 1,
 *         },
 *         metadata: {
 *             items: [
 *                 {
 *                     key: "startup-script",
 *                     value: `#!/bin/bash
 * echo 'Instance restored' > /tmp/restored.txt`,
 *                 },
 *                 {
 *                     key: "enable-oslogin",
 *                     value: "TRUE",
 *                 },
 *             ],
 *         },
 *     },
 * });
 * ```
 * ### Backup Dr Restore Workload Disk Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const restoreDiskBasic = new gcp.backupdisasterrecovery.RestoreWorkload("restore_disk_basic", {
 *     location: "us-central1",
 *     backupVaultId: "backup-vault",
 *     dataSourceId: "data-source",
 *     backupId: "backup",
 *     name: "projects/my-project/locations/us-central1/backups/my-backup",
 *     diskTargetEnvironment: {
 *         project: "my-project-name",
 *         zone: "us-central1-a",
 *     },
 *     diskRestoreProperties: {
 *         name: "restored-disk",
 *         sizeGb: 100,
 *         type: "pd-standard",
 *         description: "Restored persistent disk from backup",
 *         labels: {
 *             environment: "production",
 *             restored: "true",
 *         },
 *     },
 * });
 * ```
 * ### Backup Dr Restore Workload Regional Disk
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const restoreRegionalDisk = new gcp.backupdisasterrecovery.RestoreWorkload("restore_regional_disk", {
 *     location: "us-central1",
 *     backupVaultId: "backup-vault",
 *     dataSourceId: "data-source",
 *     backupId: "backup",
 *     name: "projects/my-project/locations/us-central1/backups/my-backup",
 *     regionDiskTargetEnvironment: {
 *         project: "my-project-name",
 *         region: "us-central1",
 *         replicaZones: [
 *             "us-central1-a",
 *             "us-central1-b",
 *         ],
 *     },
 *     diskRestoreProperties: {
 *         name: "restored-regional-disk",
 *         sizeGb: 200,
 *         type: "pd-balanced",
 *         description: "Restored regional persistent disk",
 *         labels: {
 *             type: "regional",
 *             environment: "production",
 *         },
 *         provisionedIops: 3000,
 *         provisionedThroughput: 140,
 *     },
 * });
 * ```
 * ### Backup Dr Restore Workload Without Delete
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const restoreWithoutDelete = new gcp.backupdisasterrecovery.RestoreWorkload("restore_without_delete", {
 *     location: "us-central1",
 *     backupVaultId: "backup-vault",
 *     dataSourceId: "data-source",
 *     backupId: "backup",
 *     name: "projects/my-project/locations/us-central1/backups/my-backup",
 *     deleteRestoredInstance: false,
 *     diskTargetEnvironment: {
 *         project: "my-project-name",
 *         zone: "us-central1-a",
 *     },
 *     diskRestoreProperties: {
 *         name: "persistent-disk",
 *         sizeGb: 50,
 *         type: "pd-standard",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * RestoreWorkload can be imported using any of these accepted formats:
 *
 * * `/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, RestoreWorkload can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:backupdisasterrecovery/restoreWorkload:RestoreWorkload default /{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:backupdisasterrecovery/restoreWorkload:RestoreWorkload default {{name}}
 * ```
 */
class RestoreWorkload extends pulumi.CustomResource {
    /**
     * Get an existing RestoreWorkload 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 RestoreWorkload(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of RestoreWorkload.  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'] === RestoreWorkload.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["backupId"] = state?.backupId;
            resourceInputs["backupVaultId"] = state?.backupVaultId;
            resourceInputs["clearOverridesFieldMask"] = state?.clearOverridesFieldMask;
            resourceInputs["computeInstanceRestoreProperties"] = state?.computeInstanceRestoreProperties;
            resourceInputs["computeInstanceTargetEnvironment"] = state?.computeInstanceTargetEnvironment;
            resourceInputs["dataSourceId"] = state?.dataSourceId;
            resourceInputs["deleteRestoredInstance"] = state?.deleteRestoredInstance;
            resourceInputs["diskRestoreProperties"] = state?.diskRestoreProperties;
            resourceInputs["diskTargetEnvironment"] = state?.diskTargetEnvironment;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["regionDiskTargetEnvironment"] = state?.regionDiskTargetEnvironment;
            resourceInputs["requestId"] = state?.requestId;
            resourceInputs["targetResources"] = state?.targetResources;
        }
        else {
            const args = argsOrState;
            if (args?.backupId === undefined && !opts.urn) {
                throw new Error("Missing required property 'backupId'");
            }
            if (args?.backupVaultId === undefined && !opts.urn) {
                throw new Error("Missing required property 'backupVaultId'");
            }
            if (args?.dataSourceId === undefined && !opts.urn) {
                throw new Error("Missing required property 'dataSourceId'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            resourceInputs["backupId"] = args?.backupId;
            resourceInputs["backupVaultId"] = args?.backupVaultId;
            resourceInputs["clearOverridesFieldMask"] = args?.clearOverridesFieldMask;
            resourceInputs["computeInstanceRestoreProperties"] = args?.computeInstanceRestoreProperties;
            resourceInputs["computeInstanceTargetEnvironment"] = args?.computeInstanceTargetEnvironment;
            resourceInputs["dataSourceId"] = args?.dataSourceId;
            resourceInputs["deleteRestoredInstance"] = args?.deleteRestoredInstance;
            resourceInputs["diskRestoreProperties"] = args?.diskRestoreProperties;
            resourceInputs["diskTargetEnvironment"] = args?.diskTargetEnvironment;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["regionDiskTargetEnvironment"] = args?.regionDiskTargetEnvironment;
            resourceInputs["requestId"] = args?.requestId;
            resourceInputs["targetResources"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RestoreWorkload.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RestoreWorkload = RestoreWorkload;
/** @internal */
RestoreWorkload.__pulumiType = 'gcp:backupdisasterrecovery/restoreWorkload:RestoreWorkload';
//# sourceMappingURL=restoreWorkload.js.map