"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.DbHome = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Db Home resource in Oracle Cloud Infrastructure Database service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/database/latest/DbHome
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/database
 *
 * Creates a new Database Home in the specified database system based on the request parameters you provide. Applies only to bare metal and Exadata systems.
 *
 * **Important:** Unless `enableDatabaseDelete` is explicitly set to true:
 * * Terraform will not delete the database within the Db Home configuration but rather remove it from the config and state file.
 * * This leads to dangling resources which are not managed via Terraform unless explicitly imported
 *
 * **Important:** When `autoBackupEnabled` is not present in the configuration or set to true, the `autoBackupWindow` and `autoFullBackupWindow` will be ignored
 *
 * ## Example Usage
 *
 * ## Import
 *
 * DbHomes can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:Database/dbHome:DbHome test_db_home "id"
 * ```
 *
 * Import is only supported for source=NONE
 *
 * database.0.admin_password is not returned by the service for security reasons. Add the following to the resource:
 *
 * ```sh
 *     lifecycle {
 *         ignore_changes = ["database.0.admin_password"]
 *     }
 * ```
 *
 * The creation of an oci.Database.DbSystem requires that it be created with exactly one oci_database_db_home. Therefore the first db home will have to be a property of the db system resource and any further db homes to be added to the db system will have to be added as first class resources using "oci.Database.DbHome".
 */
class DbHome extends pulumi.CustomResource {
    /**
     * Get an existing DbHome 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 DbHome(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Database/dbHome:DbHome';
    /**
     * Returns true if the given object is an instance of DbHome.  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'] === DbHome.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["database"] = state?.database;
            resourceInputs["databaseSoftwareImageId"] = state?.databaseSoftwareImageId;
            resourceInputs["dbHomeLocation"] = state?.dbHomeLocation;
            resourceInputs["dbSystemId"] = state?.dbSystemId;
            resourceInputs["dbVersion"] = state?.dbVersion;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["enableDatabaseDelete"] = state?.enableDatabaseDelete;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["isDesupportedVersion"] = state?.isDesupportedVersion;
            resourceInputs["isUnifiedAuditingEnabled"] = state?.isUnifiedAuditingEnabled;
            resourceInputs["kmsKeyId"] = state?.kmsKeyId;
            resourceInputs["kmsKeyVersionId"] = state?.kmsKeyVersionId;
            resourceInputs["lastPatchHistoryEntryId"] = state?.lastPatchHistoryEntryId;
            resourceInputs["lifecycleDetails"] = state?.lifecycleDetails;
            resourceInputs["source"] = state?.source;
            resourceInputs["state"] = state?.state;
            resourceInputs["systemTags"] = state?.systemTags;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["vmClusterId"] = state?.vmClusterId;
        }
        else {
            const args = argsOrState;
            resourceInputs["database"] = args?.database;
            resourceInputs["databaseSoftwareImageId"] = args?.databaseSoftwareImageId;
            resourceInputs["dbSystemId"] = args?.dbSystemId;
            resourceInputs["dbVersion"] = args?.dbVersion;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["enableDatabaseDelete"] = args?.enableDatabaseDelete;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["isDesupportedVersion"] = args?.isDesupportedVersion;
            resourceInputs["isUnifiedAuditingEnabled"] = args?.isUnifiedAuditingEnabled;
            resourceInputs["kmsKeyId"] = args?.kmsKeyId;
            resourceInputs["kmsKeyVersionId"] = args?.kmsKeyVersionId;
            resourceInputs["source"] = args?.source;
            resourceInputs["vmClusterId"] = args?.vmClusterId;
            resourceInputs["compartmentId"] = undefined /*out*/;
            resourceInputs["dbHomeLocation"] = undefined /*out*/;
            resourceInputs["lastPatchHistoryEntryId"] = undefined /*out*/;
            resourceInputs["lifecycleDetails"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["systemTags"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(DbHome.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DbHome = DbHome;
//# sourceMappingURL=dbHome.js.map