"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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Volume = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Volume resource in Oracle Cloud Infrastructure Core service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/iaas/latest/Volume
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/
 *
 * Creates a new volume in the specified compartment. Volumes can be created in sizes ranging from
 * 50 GB (51200 MB) to 32 TB (33554432 MB), in 1 GB (1024 MB) increments. By default, volumes are 1 TB (1048576 MB).
 * For general information about block volumes, see
 * [Overview of Block Volume Service](https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm).
 *
 * A volume and instance can be in separate compartments but must be in the same availability domain.
 * For information about access control and compartments, see
 * [Overview of the IAM Service](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/overview.htm). For information about
 * availability domains, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm).
 * To get a list of availability domains, use the `ListAvailabilityDomains` operation
 * in the Identity and Access Management Service API.
 *
 * You may optionally specify a *display name* for the volume, which is simply a friendly name or
 * description. It does not have to be unique, and you can change it. Avoid entering confidential information.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testVolume = new oci.core.Volume("test_volume", {
 *     compartmentId: compartmentId,
 *     autotunePolicies: [{
 *         autotuneType: volumeAutotunePoliciesAutotuneType,
 *         maxVpusPerGb: volumeAutotunePoliciesMaxVpusPerGb,
 *     }],
 *     availabilityDomain: volumeAvailabilityDomain,
 *     backupPolicyId: testVolumeBackupPolicies.volumeBackupPolicies[0].id,
 *     blockVolumeReplicas: [{
 *         availabilityDomain: volumeBlockVolumeReplicasAvailabilityDomain,
 *         displayName: volumeBlockVolumeReplicasDisplayName,
 *         xrrKmsKeyId: testKey.id,
 *     }],
 *     clusterPlacementGroupId: testGroup.id,
 *     definedTags: {
 *         "Operations.CostCenter": "42",
 *     },
 *     displayName: volumeDisplayName,
 *     freeformTags: {
 *         Department: "Finance",
 *     },
 *     isAutoTuneEnabled: volumeIsAutoTuneEnabled === "true",
 *     isReservationsEnabled: volumeIsReservationsEnabled === "true",
 *     kmsKeyId: testKey.id,
 *     sizeInGbs: volumeSizeInGbs,
 *     sizeInMbs: volumeSizeInMbs,
 *     sourceDetails: {
 *         type: volumeSourceDetailsType,
 *         changeBlockSizeInBytes: volumeSourceDetailsChangeBlockSizeInBytes,
 *         firstBackupId: testBackup.id,
 *         id: volumeSourceDetailsId,
 *         secondBackupId: testBackup.id,
 *     },
 *     vpusPerGb: volumeVpusPerGb,
 *     xrcKmsKeyId: testKey.id,
 *     blockVolumeReplicasDeletion: true,
 * });
 * ```
 *
 * ## Import
 *
 * Volumes can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:Core/volume:Volume test_volume "id"
 * ```
 */
class Volume extends pulumi.CustomResource {
    /**
     * Get an existing Volume 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 Volume(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Core/volume:Volume';
    /**
     * Returns true if the given object is an instance of Volume.  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'] === Volume.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["autoTunedVpusPerGb"] = state?.autoTunedVpusPerGb;
            resourceInputs["autotunePolicies"] = state?.autotunePolicies;
            resourceInputs["availabilityDomain"] = state?.availabilityDomain;
            resourceInputs["backupPolicyId"] = state?.backupPolicyId;
            resourceInputs["blockVolumeReplicas"] = state?.blockVolumeReplicas;
            resourceInputs["blockVolumeReplicasDeletion"] = state?.blockVolumeReplicasDeletion;
            resourceInputs["clusterPlacementGroupId"] = state?.clusterPlacementGroupId;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["isAutoTuneEnabled"] = state?.isAutoTuneEnabled;
            resourceInputs["isHydrated"] = state?.isHydrated;
            resourceInputs["isReservationsEnabled"] = state?.isReservationsEnabled;
            resourceInputs["kmsKeyId"] = state?.kmsKeyId;
            resourceInputs["sizeInGbs"] = state?.sizeInGbs;
            resourceInputs["sizeInMbs"] = state?.sizeInMbs;
            resourceInputs["sourceDetails"] = state?.sourceDetails;
            resourceInputs["state"] = state?.state;
            resourceInputs["systemTags"] = state?.systemTags;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["volumeBackupId"] = state?.volumeBackupId;
            resourceInputs["volumeGroupId"] = state?.volumeGroupId;
            resourceInputs["vpusPerGb"] = state?.vpusPerGb;
            resourceInputs["xrcKmsKeyId"] = state?.xrcKmsKeyId;
        }
        else {
            const args = argsOrState;
            if (args?.availabilityDomain === undefined && !opts.urn) {
                throw new Error("Missing required property 'availabilityDomain'");
            }
            if (args?.compartmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'compartmentId'");
            }
            resourceInputs["autotunePolicies"] = args?.autotunePolicies;
            resourceInputs["availabilityDomain"] = args?.availabilityDomain;
            resourceInputs["backupPolicyId"] = args?.backupPolicyId;
            resourceInputs["blockVolumeReplicas"] = args?.blockVolumeReplicas;
            resourceInputs["blockVolumeReplicasDeletion"] = args?.blockVolumeReplicasDeletion;
            resourceInputs["clusterPlacementGroupId"] = args?.clusterPlacementGroupId;
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["isAutoTuneEnabled"] = args?.isAutoTuneEnabled;
            resourceInputs["isReservationsEnabled"] = args?.isReservationsEnabled;
            resourceInputs["kmsKeyId"] = args?.kmsKeyId;
            resourceInputs["sizeInGbs"] = args?.sizeInGbs;
            resourceInputs["sizeInMbs"] = args?.sizeInMbs;
            resourceInputs["sourceDetails"] = args?.sourceDetails;
            resourceInputs["volumeBackupId"] = args?.volumeBackupId;
            resourceInputs["vpusPerGb"] = args?.vpusPerGb;
            resourceInputs["xrcKmsKeyId"] = args?.xrcKmsKeyId;
            resourceInputs["autoTunedVpusPerGb"] = undefined /*out*/;
            resourceInputs["isHydrated"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["systemTags"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["volumeGroupId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Volume.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Volume = Volume;
//# sourceMappingURL=volume.js.map