"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 Psql service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/postgresql/latest/DbSystem
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/psql
 *
 * Creates a new database system.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testDbSystem = new oci.psql.DbSystem("test_db_system", {
 *     compartmentId: compartmentId,
 *     credentials: {
 *         passwordDetails: {
 *             passwordType: dbSystemCredentialsPasswordDetailsPasswordType,
 *             password: dbSystemCredentialsPasswordDetailsPassword,
 *             secretId: testSecret.id,
 *             secretVersion: dbSystemCredentialsPasswordDetailsSecretVersion,
 *         },
 *         username: dbSystemCredentialsUsername,
 *     },
 *     dbVersion: dbSystemDbVersion,
 *     displayName: dbSystemDisplayName,
 *     networkDetails: {
 *         subnetId: testSubnet.id,
 *         isReaderEndpointEnabled: dbSystemNetworkDetailsIsReaderEndpointEnabled === "true",
 *         nsgIds: dbSystemNetworkDetailsNsgIds,
 *         primaryDbEndpointPrivateIp: dbSystemNetworkDetailsPrimaryDbEndpointPrivateIp,
 *     },
 *     shape: dbSystemShape,
 *     storageDetails: {
 *         isRegionallyDurable: dbSystemStorageDetailsIsRegionallyDurable === "true",
 *         systemType: dbSystemStorageDetailsSystemType,
 *         availabilityDomain: dbSystemStorageDetailsAvailabilityDomain,
 *         iops: dbSystemStorageDetailsIops,
 *     },
 *     configId: testConfig.id,
 *     definedTags: {
 *         "foo-namespace.bar-key": "value",
 *     },
 *     description: dbSystemDescription,
 *     freeformTags: {
 *         "bar-key": "value",
 *     },
 *     instanceCount: Number(dbSystemInstanceCount),
 *     instanceMemorySizeInGbs: Number(dbSystemInstanceMemorySizeInGbs),
 *     instanceOcpuCount: Number(dbSystemInstanceOcpuCount),
 *     instancesDetails: [{
 *         description: dbSystemInstancesDetailsDescription,
 *         displayName: dbSystemInstancesDetailsDisplayName,
 *         privateIp: dbSystemInstancesDetailsPrivateIp,
 *     }],
 *     managementPolicy: {
 *         backupPolicy: {
 *             backupStart: dbSystemManagementPolicyBackupPolicyBackupStart,
 *             copyPolicy: {
 *                 compartmentId: compartmentId,
 *                 regions: dbSystemManagementPolicyBackupPolicyCopyPolicyRegions,
 *                 retentionPeriod: Number(dbSystemManagementPolicyBackupPolicyCopyPolicyRetentionPeriod),
 *             },
 *             daysOfTheMonths: dbSystemManagementPolicyBackupPolicyDaysOfTheMonth,
 *             daysOfTheWeeks: dbSystemManagementPolicyBackupPolicyDaysOfTheWeek,
 *             kind: dbSystemManagementPolicyBackupPolicyKind,
 *             retentionDays: Number(dbSystemManagementPolicyBackupPolicyRetentionDays),
 *         },
 *         maintenanceWindowStart: dbSystemManagementPolicyMaintenanceWindowStart,
 *     },
 *     source: {
 *         sourceType: dbSystemSourceSourceType,
 *         backupId: testBackup.id,
 *         isHavingRestoreConfigOverrides: dbSystemSourceIsHavingRestoreConfigOverrides === "true",
 *     },
 *     systemType: dbSystemSystemType,
 *     patchOperations: [{
 *         operation: dbSystemPatchOperationsOperation,
 *         selection: dbSystemPatchOperationsSelection,
 *         value: dbSystemPatchOperationsValue,
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * DbSystems can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:Psql/dbSystem:DbSystem test_db_system "id"
 * ```
 */
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:Psql/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["adminUsername"] = state?.adminUsername;
            resourceInputs["applyConfig"] = state?.applyConfig;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["configId"] = state?.configId;
            resourceInputs["credentials"] = state?.credentials;
            resourceInputs["dbVersion"] = state?.dbVersion;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["description"] = state?.description;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["instanceCount"] = state?.instanceCount;
            resourceInputs["instanceMemorySizeInGbs"] = state?.instanceMemorySizeInGbs;
            resourceInputs["instanceOcpuCount"] = state?.instanceOcpuCount;
            resourceInputs["instances"] = state?.instances;
            resourceInputs["instancesDetails"] = state?.instancesDetails;
            resourceInputs["lifecycleDetails"] = state?.lifecycleDetails;
            resourceInputs["managementPolicy"] = state?.managementPolicy;
            resourceInputs["networkDetails"] = state?.networkDetails;
            resourceInputs["patchOperations"] = state?.patchOperations;
            resourceInputs["shape"] = state?.shape;
            resourceInputs["source"] = state?.source;
            resourceInputs["state"] = state?.state;
            resourceInputs["storageDetails"] = state?.storageDetails;
            resourceInputs["systemTags"] = state?.systemTags;
            resourceInputs["systemType"] = state?.systemType;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeUpdated"] = state?.timeUpdated;
        }
        else {
            const args = argsOrState;
            if (args?.compartmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'compartmentId'");
            }
            if (args?.dbVersion === undefined && !opts.urn) {
                throw new Error("Missing required property 'dbVersion'");
            }
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.networkDetails === undefined && !opts.urn) {
                throw new Error("Missing required property 'networkDetails'");
            }
            if (args?.shape === undefined && !opts.urn) {
                throw new Error("Missing required property 'shape'");
            }
            if (args?.storageDetails === undefined && !opts.urn) {
                throw new Error("Missing required property 'storageDetails'");
            }
            resourceInputs["applyConfig"] = args?.applyConfig;
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["configId"] = args?.configId;
            resourceInputs["credentials"] = args?.credentials;
            resourceInputs["dbVersion"] = args?.dbVersion;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["instanceCount"] = args?.instanceCount;
            resourceInputs["instanceMemorySizeInGbs"] = args?.instanceMemorySizeInGbs;
            resourceInputs["instanceOcpuCount"] = args?.instanceOcpuCount;
            resourceInputs["instancesDetails"] = args?.instancesDetails;
            resourceInputs["managementPolicy"] = args?.managementPolicy;
            resourceInputs["networkDetails"] = args?.networkDetails;
            resourceInputs["patchOperations"] = args?.patchOperations;
            resourceInputs["shape"] = args?.shape;
            resourceInputs["source"] = args?.source;
            resourceInputs["storageDetails"] = args?.storageDetails;
            resourceInputs["systemType"] = args?.systemType;
            resourceInputs["adminUsername"] = undefined /*out*/;
            resourceInputs["instances"] = undefined /*out*/;
            resourceInputs["lifecycleDetails"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["systemTags"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["timeUpdated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(DbSystem.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DbSystem = DbSystem;
//# sourceMappingURL=dbSystem.js.map