"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.DbSystem = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Db System resource in Oracle Cloud Infrastructure Database service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/database/latest/DbSystem
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/database
 *
 * Creates a new DB system in the specified compartment and availability domain. The Oracle
 * Database edition that you specify applies to all the databases on that DB system. The selected edition cannot be changed.
 *
 * An initial database is created on the DB system based on the request parameters you provide and some default
 * options. For detailed information about default options, see [Bare metal and virtual machine DB system default options.](https://docs.cloud.oracle.com/iaas/Content/Database/Tasks/creatingDBsystem.htm#Default)
 *
 * **Note:** Deprecated for Exadata Cloud Service systems. Use the [new resource model APIs](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/exaflexsystem.htm#exaflexsystem_topic-resource_model) instead.
 *
 * For Exadata Cloud Service instances, support for this API will end on May 15th, 2021. See [Switching an Exadata DB System to the New Resource Model and APIs](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/exaflexsystem_topic-resource_model_conversion.htm) for details on converting existing Exadata DB systems to the new resource model.
 *
 * Use the [CreateCloudExadataInfrastructure](https://docs.cloud.oracle.com/iaas/api/#/en/database/latest/CloudExadataInfrastructure/CreateCloudExadataInfrastructure/) and [CreateCloudVmCluster](https://docs.cloud.oracle.com/iaas/api/#/en/database/latest/CloudVmCluster/CreateCloudVmCluster/) APIs to provision a new Exadata Cloud Service instance.
 *
 * **Important:** When `autoBackupEnabled` is not present in the configuration or set to true, the `autoBackupWindow` and `autoFullBackupWindow` will be ignored
 *
 * ## Import
 *
 * DbSystems can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:Database/dbSystem:DbSystem test_db_system "id"
 * ```
 *
 * Import is only supported for source=NONE
 *
 * `db_home.0.database.0.admin_password` is not returned by the service for security reasons. To avoid a force new of the dbHome on the next apply, add the following to the resource:
 *
 * ```sh
 *     lifecycle {
 *         ignore_changes = ["db_home.0.database.0.admin_password"]
 *     }
 * ```
 * You may also need to add `hostname` to the ignoreChanges list if you see a diff on a subsequent apply
 *
 * If the oci.Database.DbSystem being imported is missing a primary db_home, an empty placeholder for `dbHome` will be set in the Terraform state.
 * To keep configurations consistent with the imported state, add an empty placeholder for `dbHome` to your configuration like this:
 *
 * ```sh
 *   # Add this placeholder into your oci_database_db_system configuration to indicate that the primary db home is empty.
 *   db_home {
 *     database {
 *       admin_password = ""
 *     }
 *   }
 * ```
 */
class DbSystem extends pulumi.CustomResource {
    /**
     * Get an existing DbSystem 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 DbSystem(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Database/dbSystem:DbSystem';
    /**
     * Returns true if the given object is an instance of DbSystem.  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'] === DbSystem.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["availabilityDomain"] = state?.availabilityDomain;
            resourceInputs["backupNetworkNsgIds"] = state?.backupNetworkNsgIds;
            resourceInputs["backupSubnetId"] = state?.backupSubnetId;
            resourceInputs["clusterName"] = state?.clusterName;
            resourceInputs["clusterPlacementGroupId"] = state?.clusterPlacementGroupId;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["computeCount"] = state?.computeCount;
            resourceInputs["computeModel"] = state?.computeModel;
            resourceInputs["cpuCoreCount"] = state?.cpuCoreCount;
            resourceInputs["dataCollectionOptions"] = state?.dataCollectionOptions;
            resourceInputs["dataStoragePercentage"] = state?.dataStoragePercentage;
            resourceInputs["dataStorageSizeInGb"] = state?.dataStorageSizeInGb;
            resourceInputs["databaseEdition"] = state?.databaseEdition;
            resourceInputs["dbHome"] = state?.dbHome;
            resourceInputs["dbSystemOptions"] = state?.dbSystemOptions;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["diskRedundancy"] = state?.diskRedundancy;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["domain"] = state?.domain;
            resourceInputs["faultDomains"] = state?.faultDomains;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["hostname"] = state?.hostname;
            resourceInputs["iormConfigCaches"] = state?.iormConfigCaches;
            resourceInputs["kmsKeyId"] = state?.kmsKeyId;
            resourceInputs["kmsKeyVersionId"] = state?.kmsKeyVersionId;
            resourceInputs["lastMaintenanceRunId"] = state?.lastMaintenanceRunId;
            resourceInputs["lastPatchHistoryEntryId"] = state?.lastPatchHistoryEntryId;
            resourceInputs["licenseModel"] = state?.licenseModel;
            resourceInputs["lifecycleDetails"] = state?.lifecycleDetails;
            resourceInputs["listenerPort"] = state?.listenerPort;
            resourceInputs["maintenanceWindowDetails"] = state?.maintenanceWindowDetails;
            resourceInputs["maintenanceWindows"] = state?.maintenanceWindows;
            resourceInputs["memorySizeInGbs"] = state?.memorySizeInGbs;
            resourceInputs["nextMaintenanceRunId"] = state?.nextMaintenanceRunId;
            resourceInputs["nodeCount"] = state?.nodeCount;
            resourceInputs["nsgIds"] = state?.nsgIds;
            resourceInputs["osPatchAction"] = state?.osPatchAction;
            resourceInputs["osPatchDbNodeId"] = state?.osPatchDbNodeId;
            resourceInputs["osPatchTrigger"] = state?.osPatchTrigger;
            resourceInputs["osVersion"] = state?.osVersion;
            resourceInputs["pointInTimeDataDiskCloneTimestamp"] = state?.pointInTimeDataDiskCloneTimestamp;
            resourceInputs["primaryDbSystemId"] = state?.primaryDbSystemId;
            resourceInputs["privateIp"] = state?.privateIp;
            resourceInputs["privateIpV6"] = state?.privateIpV6;
            resourceInputs["recoStorageSizeInGb"] = state?.recoStorageSizeInGb;
            resourceInputs["scanDnsName"] = state?.scanDnsName;
            resourceInputs["scanDnsRecordId"] = state?.scanDnsRecordId;
            resourceInputs["scanIpIds"] = state?.scanIpIds;
            resourceInputs["scanIpv6ids"] = state?.scanIpv6ids;
            resourceInputs["securityAttributes"] = state?.securityAttributes;
            resourceInputs["shape"] = state?.shape;
            resourceInputs["source"] = state?.source;
            resourceInputs["sourceDbSystemId"] = state?.sourceDbSystemId;
            resourceInputs["sparseDiskgroup"] = state?.sparseDiskgroup;
            resourceInputs["sshPublicKeys"] = state?.sshPublicKeys;
            resourceInputs["state"] = state?.state;
            resourceInputs["storageVolumePerformanceMode"] = state?.storageVolumePerformanceMode;
            resourceInputs["subnetId"] = state?.subnetId;
            resourceInputs["subscriptionId"] = state?.subscriptionId;
            resourceInputs["systemTags"] = state?.systemTags;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeZone"] = state?.timeZone;
            resourceInputs["version"] = state?.version;
            resourceInputs["vipIds"] = state?.vipIds;
            resourceInputs["vipv6ids"] = state?.vipv6ids;
            resourceInputs["zoneId"] = state?.zoneId;
        }
        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'");
            }
            if (args?.dbHome === undefined && !opts.urn) {
                throw new Error("Missing required property 'dbHome'");
            }
            if (args?.hostname === undefined && !opts.urn) {
                throw new Error("Missing required property 'hostname'");
            }
            if (args?.shape === undefined && !opts.urn) {
                throw new Error("Missing required property 'shape'");
            }
            if (args?.sshPublicKeys === undefined && !opts.urn) {
                throw new Error("Missing required property 'sshPublicKeys'");
            }
            if (args?.subnetId === undefined && !opts.urn) {
                throw new Error("Missing required property 'subnetId'");
            }
            resourceInputs["availabilityDomain"] = args?.availabilityDomain;
            resourceInputs["backupNetworkNsgIds"] = args?.backupNetworkNsgIds;
            resourceInputs["backupSubnetId"] = args?.backupSubnetId;
            resourceInputs["clusterName"] = args?.clusterName;
            resourceInputs["clusterPlacementGroupId"] = args?.clusterPlacementGroupId;
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["computeCount"] = args?.computeCount;
            resourceInputs["computeModel"] = args?.computeModel;
            resourceInputs["cpuCoreCount"] = args?.cpuCoreCount;
            resourceInputs["dataCollectionOptions"] = args?.dataCollectionOptions;
            resourceInputs["dataStoragePercentage"] = args?.dataStoragePercentage;
            resourceInputs["dataStorageSizeInGb"] = args?.dataStorageSizeInGb;
            resourceInputs["databaseEdition"] = args?.databaseEdition;
            resourceInputs["dbHome"] = args?.dbHome;
            resourceInputs["dbSystemOptions"] = args?.dbSystemOptions;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["diskRedundancy"] = args?.diskRedundancy;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["domain"] = args?.domain;
            resourceInputs["faultDomains"] = args?.faultDomains;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["hostname"] = args?.hostname;
            resourceInputs["kmsKeyId"] = args?.kmsKeyId;
            resourceInputs["kmsKeyVersionId"] = args?.kmsKeyVersionId;
            resourceInputs["licenseModel"] = args?.licenseModel;
            resourceInputs["maintenanceWindowDetails"] = args?.maintenanceWindowDetails;
            resourceInputs["nodeCount"] = args?.nodeCount;
            resourceInputs["nsgIds"] = args?.nsgIds;
            resourceInputs["osPatchAction"] = args?.osPatchAction;
            resourceInputs["osPatchDbNodeId"] = args?.osPatchDbNodeId;
            resourceInputs["osPatchTrigger"] = args?.osPatchTrigger;
            resourceInputs["primaryDbSystemId"] = args?.primaryDbSystemId;
            resourceInputs["privateIp"] = args?.privateIp;
            resourceInputs["privateIpV6"] = args?.privateIpV6;
            resourceInputs["recoStorageSizeInGb"] = args?.recoStorageSizeInGb;
            resourceInputs["securityAttributes"] = args?.securityAttributes;
            resourceInputs["shape"] = args?.shape;
            resourceInputs["source"] = args?.source;
            resourceInputs["sourceDbSystemId"] = args?.sourceDbSystemId;
            resourceInputs["sparseDiskgroup"] = args?.sparseDiskgroup;
            resourceInputs["sshPublicKeys"] = args?.sshPublicKeys;
            resourceInputs["storageVolumePerformanceMode"] = args?.storageVolumePerformanceMode;
            resourceInputs["subnetId"] = args?.subnetId;
            resourceInputs["subscriptionId"] = args?.subscriptionId;
            resourceInputs["timeZone"] = args?.timeZone;
            resourceInputs["iormConfigCaches"] = undefined /*out*/;
            resourceInputs["lastMaintenanceRunId"] = undefined /*out*/;
            resourceInputs["lastPatchHistoryEntryId"] = undefined /*out*/;
            resourceInputs["lifecycleDetails"] = undefined /*out*/;
            resourceInputs["listenerPort"] = undefined /*out*/;
            resourceInputs["maintenanceWindows"] = undefined /*out*/;
            resourceInputs["memorySizeInGbs"] = undefined /*out*/;
            resourceInputs["nextMaintenanceRunId"] = undefined /*out*/;
            resourceInputs["osVersion"] = undefined /*out*/;
            resourceInputs["pointInTimeDataDiskCloneTimestamp"] = undefined /*out*/;
            resourceInputs["scanDnsName"] = undefined /*out*/;
            resourceInputs["scanDnsRecordId"] = undefined /*out*/;
            resourceInputs["scanIpIds"] = undefined /*out*/;
            resourceInputs["scanIpv6ids"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["systemTags"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["version"] = undefined /*out*/;
            resourceInputs["vipIds"] = undefined /*out*/;
            resourceInputs["vipv6ids"] = undefined /*out*/;
            resourceInputs["zoneId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(DbSystem.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DbSystem = DbSystem;
//# sourceMappingURL=dbSystem.js.map