"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.MysqlDbSystem = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Mysql Db System resource in Oracle Cloud Infrastructure MySQL Database service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/mysql/latest/MysqlDbSystem
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/mysql
 *
 * Creates and launches a DB System.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testMysqlDbSystem = new oci.mysql.MysqlDbSystem("test_mysql_db_system", {
 *     availabilityDomain: mysqlDbSystemAvailabilityDomain,
 *     compartmentId: compartmentId,
 *     shapeName: mysqlShapeName,
 *     subnetId: testSubnet.id,
 *     accessMode: mysqlDbSystemAccessMode,
 *     adminPassword: mysqlDbSystemAdminPassword,
 *     adminUsername: mysqlDbSystemAdminUsername,
 *     backupPolicy: {
 *         copyPolicies: [{
 *             copyToRegion: mysqlDbSystemBackupPolicyCopyPoliciesCopyToRegion,
 *             backupCopyRetentionInDays: Number(mysqlDbSystemBackupPolicyCopyPoliciesBackupCopyRetentionInDays),
 *         }],
 *         definedTags: {
 *             "foo-namespace.bar-key": "value",
 *         },
 *         freeformTags: {
 *             "bar-key": "value",
 *         },
 *         isEnabled: mysqlDbSystemBackupPolicyIsEnabled === "true",
 *         pitrPolicy: {
 *             isEnabled: mysqlDbSystemBackupPolicyPitrPolicyIsEnabled === "true",
 *         },
 *         retentionInDays: Number(mysqlDbSystemBackupPolicyRetentionInDays),
 *         softDelete: mysqlDbSystemBackupPolicySoftDelete,
 *         windowStartTime: mysqlDbSystemBackupPolicyWindowStartTime,
 *     },
 *     configurationId: testConfiguration.id,
 *     crashRecovery: mysqlDbSystemCrashRecovery,
 *     customerContacts: [{
 *         email: mysqlDbSystemCustomerContactsEmail,
 *     }],
 *     dataStorage: {
 *         isAutoExpandStorageEnabled: mysqlDbSystemDataStorageIsAutoExpandStorageEnabled === "true",
 *         maxStorageSizeInGbs: Number(mysqlDbSystemDataStorageMaxStorageSizeInGbs),
 *     },
 *     dataStorageSizeInGb: Number(mysqlDbSystemDataStorageSizeInGb),
 *     databaseConsole: {
 *         status: mysqlDbSystemDatabaseConsoleStatus,
 *         port: Number(mysqlDbSystemDatabaseConsolePort),
 *     },
 *     databaseManagement: mysqlDbSystemDatabaseManagement,
 *     databaseMode: mysqlDbSystemDatabaseMode,
 *     definedTags: {
 *         "foo-namespace.bar-key": "value",
 *     },
 *     deletionPolicies: [{
 *         automaticBackupRetention: mysqlDbSystemDeletionPolicyAutomaticBackupRetention,
 *         finalBackup: mysqlDbSystemDeletionPolicyFinalBackup,
 *         isDeleteProtected: mysqlDbSystemDeletionPolicyIsDeleteProtected === "true",
 *     }],
 *     description: mysqlDbSystemDescription,
 *     displayName: mysqlDbSystemDisplayName,
 *     encryptData: {
 *         keyGenerationType: mysqlDbSystemEncryptDataKeyGenerationType,
 *         keyId: testKey.id,
 *     },
 *     faultDomain: mysqlDbSystemFaultDomain,
 *     freeformTags: {
 *         "bar-key": "value",
 *     },
 *     hostnameLabel: mysqlDbSystemHostnameLabel,
 *     ipAddress: mysqlDbSystemIpAddress,
 *     isHighlyAvailable: mysqlDbSystemIsHighlyAvailable === "true",
 *     maintenance: {
 *         windowStartTime: mysqlDbSystemMaintenanceWindowStartTime,
 *         maintenanceDisabledWindows: [{
 *             timeEnd: mysqlDbSystemMaintenanceMaintenanceDisabledWindowsTimeEnd,
 *             timeStart: mysqlDbSystemMaintenanceMaintenanceDisabledWindowsTimeStart,
 *         }],
 *         maintenanceScheduleType: mysqlDbSystemMaintenanceMaintenanceScheduleType,
 *         versionPreference: mysqlDbSystemMaintenanceVersionPreference,
 *         versionTrackPreference: mysqlDbSystemMaintenanceVersionTrackPreference,
 *     },
 *     nsgIds: mysqlDbSystemNsgIds,
 *     port: Number(mysqlDbSystemPort),
 *     portX: Number(mysqlDbSystemPortX),
 *     readEndpoint: {
 *         excludeIps: mysqlDbSystemReadEndpointExcludeIps,
 *         isEnabled: mysqlDbSystemReadEndpointIsEnabled === "true",
 *         readEndpointHostnameLabel: mysqlDbSystemReadEndpointReadEndpointHostnameLabel,
 *         readEndpointIpAddress: mysqlDbSystemReadEndpointReadEndpointIpAddress,
 *     },
 *     rest: {
 *         configuration: mysqlDbSystemRestConfiguration,
 *         port: Number(mysqlDbSystemRestPort),
 *     },
 *     secureConnections: {
 *         certificateGenerationType: mysqlDbSystemSecureConnectionsCertificateGenerationType,
 *         certificateId: testCertificate.id,
 *     },
 *     securityAttributes: mysqlDbSystemSecurityAttributes,
 *     source: {
 *         sourceType: mysqlDbSystemSourceSourceType,
 *         backupId: testBackup.id,
 *     },
 *     telemetryConfiguration: {
 *         logs: [{
 *             destination: mysqlDbSystemTelemetryConfigurationLogsDestination,
 *             destinationConfigurations: [{
 *                 key: mysqlDbSystemTelemetryConfigurationLogsDestinationConfigurationsKey,
 *                 value: mysqlDbSystemTelemetryConfigurationLogsDestinationConfigurationsValue,
 *             }],
 *             logTypes: mysqlDbSystemTelemetryConfigurationLogsLogTypes,
 *         }],
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * MysqlDbSystems can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:Mysql/mysqlDbSystem:MysqlDbSystem test_mysql_db_system "id"
 * ```
 */
class MysqlDbSystem extends pulumi.CustomResource {
    /**
     * Get an existing MysqlDbSystem 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 MysqlDbSystem(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Mysql/mysqlDbSystem:MysqlDbSystem';
    /**
     * Returns true if the given object is an instance of MysqlDbSystem.  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'] === MysqlDbSystem.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accessMode"] = state?.accessMode;
            resourceInputs["adminPassword"] = state?.adminPassword;
            resourceInputs["adminUsername"] = state?.adminUsername;
            resourceInputs["availabilityDomain"] = state?.availabilityDomain;
            resourceInputs["backupPolicy"] = state?.backupPolicy;
            resourceInputs["channels"] = state?.channels;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["configurationId"] = state?.configurationId;
            resourceInputs["crashRecovery"] = state?.crashRecovery;
            resourceInputs["currentPlacements"] = state?.currentPlacements;
            resourceInputs["customerContacts"] = state?.customerContacts;
            resourceInputs["dataStorage"] = state?.dataStorage;
            resourceInputs["dataStorageSizeInGb"] = state?.dataStorageSizeInGb;
            resourceInputs["databaseConsole"] = state?.databaseConsole;
            resourceInputs["databaseManagement"] = state?.databaseManagement;
            resourceInputs["databaseMode"] = state?.databaseMode;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["deletionPolicies"] = state?.deletionPolicies;
            resourceInputs["description"] = state?.description;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["encryptData"] = state?.encryptData;
            resourceInputs["endpoints"] = state?.endpoints;
            resourceInputs["faultDomain"] = state?.faultDomain;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["heatWaveClusters"] = state?.heatWaveClusters;
            resourceInputs["hostnameLabel"] = state?.hostnameLabel;
            resourceInputs["ipAddress"] = state?.ipAddress;
            resourceInputs["isHeatWaveClusterAttached"] = state?.isHeatWaveClusterAttached;
            resourceInputs["isHighlyAvailable"] = state?.isHighlyAvailable;
            resourceInputs["lifecycleDetails"] = state?.lifecycleDetails;
            resourceInputs["maintenance"] = state?.maintenance;
            resourceInputs["mysqlVersion"] = state?.mysqlVersion;
            resourceInputs["nsgIds"] = state?.nsgIds;
            resourceInputs["pointInTimeRecoveryDetails"] = state?.pointInTimeRecoveryDetails;
            resourceInputs["port"] = state?.port;
            resourceInputs["portX"] = state?.portX;
            resourceInputs["readEndpoint"] = state?.readEndpoint;
            resourceInputs["rest"] = state?.rest;
            resourceInputs["secureConnections"] = state?.secureConnections;
            resourceInputs["securityAttributes"] = state?.securityAttributes;
            resourceInputs["shapeName"] = state?.shapeName;
            resourceInputs["shutdownType"] = state?.shutdownType;
            resourceInputs["source"] = state?.source;
            resourceInputs["state"] = state?.state;
            resourceInputs["subnetId"] = state?.subnetId;
            resourceInputs["systemTags"] = state?.systemTags;
            resourceInputs["telemetryConfiguration"] = state?.telemetryConfiguration;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeUpdated"] = state?.timeUpdated;
        }
        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?.shapeName === undefined && !opts.urn) {
                throw new Error("Missing required property 'shapeName'");
            }
            if (args?.subnetId === undefined && !opts.urn) {
                throw new Error("Missing required property 'subnetId'");
            }
            resourceInputs["accessMode"] = args?.accessMode;
            resourceInputs["adminPassword"] = args?.adminPassword ? pulumi.secret(args.adminPassword) : undefined;
            resourceInputs["adminUsername"] = args?.adminUsername;
            resourceInputs["availabilityDomain"] = args?.availabilityDomain;
            resourceInputs["backupPolicy"] = args?.backupPolicy;
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["configurationId"] = args?.configurationId;
            resourceInputs["crashRecovery"] = args?.crashRecovery;
            resourceInputs["customerContacts"] = args?.customerContacts;
            resourceInputs["dataStorage"] = args?.dataStorage;
            resourceInputs["dataStorageSizeInGb"] = args?.dataStorageSizeInGb;
            resourceInputs["databaseConsole"] = args?.databaseConsole;
            resourceInputs["databaseManagement"] = args?.databaseManagement;
            resourceInputs["databaseMode"] = args?.databaseMode;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["deletionPolicies"] = args?.deletionPolicies;
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["encryptData"] = args?.encryptData;
            resourceInputs["faultDomain"] = args?.faultDomain;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["hostnameLabel"] = args?.hostnameLabel;
            resourceInputs["ipAddress"] = args?.ipAddress;
            resourceInputs["isHighlyAvailable"] = args?.isHighlyAvailable;
            resourceInputs["maintenance"] = args?.maintenance;
            resourceInputs["mysqlVersion"] = args?.mysqlVersion;
            resourceInputs["nsgIds"] = args?.nsgIds;
            resourceInputs["port"] = args?.port;
            resourceInputs["portX"] = args?.portX;
            resourceInputs["readEndpoint"] = args?.readEndpoint;
            resourceInputs["rest"] = args?.rest;
            resourceInputs["secureConnections"] = args?.secureConnections;
            resourceInputs["securityAttributes"] = args?.securityAttributes;
            resourceInputs["shapeName"] = args?.shapeName;
            resourceInputs["shutdownType"] = args?.shutdownType;
            resourceInputs["source"] = args?.source;
            resourceInputs["state"] = args?.state;
            resourceInputs["subnetId"] = args?.subnetId;
            resourceInputs["telemetryConfiguration"] = args?.telemetryConfiguration;
            resourceInputs["channels"] = undefined /*out*/;
            resourceInputs["currentPlacements"] = undefined /*out*/;
            resourceInputs["endpoints"] = undefined /*out*/;
            resourceInputs["heatWaveClusters"] = undefined /*out*/;
            resourceInputs["isHeatWaveClusterAttached"] = undefined /*out*/;
            resourceInputs["lifecycleDetails"] = undefined /*out*/;
            resourceInputs["pointInTimeRecoveryDetails"] = undefined /*out*/;
            resourceInputs["systemTags"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["timeUpdated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["adminPassword"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(MysqlDbSystem.__pulumiType, name, resourceInputs, opts);
    }
}
exports.MysqlDbSystem = MysqlDbSystem;
//# sourceMappingURL=mysqlDbSystem.js.map