"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.DistributedDatabaseDistributedAutonomousDatabase = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Distributed Autonomous Database resource in Oracle Cloud Infrastructure Distributed Database service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/globally-distributed-database/latest/DistributedAutonomousDatabase
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/distributed_database
 *
 * Creates a Globally distributed autonomous database.
 *
 *   Patch operation to add, remove or update shards to the Globally distributed autonomous database topology. In single patch
 * operation, multiple shards can be either added, or removed or updated. Combination of inserts, update
 * and remove in single operation is not allowed.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testDistributedAutonomousDatabase = new oci.oci.DistributedDatabaseDistributedAutonomousDatabase("test_distributed_autonomous_database", {
 *     catalogDetails: [{
 *         adminPassword: distributedAutonomousDatabaseCatalogDetailsAdminPassword,
 *         cloudAutonomousVmClusterId: testCloudAutonomousVmCluster.id,
 *         computeCount: distributedAutonomousDatabaseCatalogDetailsComputeCount,
 *         dataStorageSizeInGbs: distributedAutonomousDatabaseCatalogDetailsDataStorageSizeInGbs,
 *         isAutoScalingEnabled: distributedAutonomousDatabaseCatalogDetailsIsAutoScalingEnabled === "true",
 *         source: distributedAutonomousDatabaseCatalogDetailsSource,
 *         kmsKeyId: testKey.id,
 *         kmsKeyVersionId: testKeyVersion.id,
 *         okvEndPointGroup: distributedAutonomousDatabaseCatalogDetailsOkvEndPointGroup,
 *         okvKeyStoreId: testKeyStore.id,
 *         peerCloudAutonomousVmClusterIds: distributedAutonomousDatabaseCatalogDetailsPeerCloudAutonomousVmClusterIds,
 *         peerDetails: [{
 *             cloudAutonomousVmClusterId: testCloudAutonomousVmCluster.id,
 *             fastStartFailOverLagLimitInSeconds: Number(distributedAutonomousDatabaseCatalogDetailsPeerDetailsFastStartFailOverLagLimitInSeconds),
 *             isAutomaticFailoverEnabled: distributedAutonomousDatabaseCatalogDetailsPeerDetailsIsAutomaticFailoverEnabled === "true",
 *             protectionMode: distributedAutonomousDatabaseCatalogDetailsPeerDetailsProtectionMode,
 *             standbyMaintenanceBufferInDays: Number(distributedAutonomousDatabaseCatalogDetailsPeerDetailsStandbyMaintenanceBufferInDays),
 *         }],
 *         vaultId: testVault.id,
 *     }],
 *     characterSet: distributedAutonomousDatabaseCharacterSet,
 *     compartmentId: compartmentId,
 *     databaseVersion: distributedAutonomousDatabaseDatabaseVersion,
 *     dbDeploymentType: distributedAutonomousDatabaseDbDeploymentType,
 *     dbWorkload: distributedAutonomousDatabaseDbWorkload,
 *     displayName: distributedAutonomousDatabaseDisplayName,
 *     distributedAutonomousDatabaseId: distributedAutonomousDatabaseDistributedAutonomousDatabaseId,
 *     listenerPort: Number(distributedAutonomousDatabaseListenerPort),
 *     ncharacterSet: distributedAutonomousDatabaseNcharacterSet,
 *     onsPortLocal: Number(distributedAutonomousDatabaseOnsPortLocal),
 *     onsPortRemote: Number(distributedAutonomousDatabaseOnsPortRemote),
 *     prefix: distributedAutonomousDatabasePrefix,
 *     privateEndpointIds: distributedAutonomousDatabasePrivateEndpointIds,
 *     shardDetails: [{
 *         adminPassword: distributedAutonomousDatabaseShardDetailsAdminPassword,
 *         cloudAutonomousVmClusterId: testCloudAutonomousVmCluster.id,
 *         computeCount: distributedAutonomousDatabaseShardDetailsComputeCount,
 *         dataStorageSizeInGbs: distributedAutonomousDatabaseShardDetailsDataStorageSizeInGbs,
 *         isAutoScalingEnabled: distributedAutonomousDatabaseShardDetailsIsAutoScalingEnabled === "true",
 *         source: distributedAutonomousDatabaseShardDetailsSource,
 *         kmsKeyId: testKey.id,
 *         kmsKeyVersionId: testKeyVersion.id,
 *         okvEndPointGroup: distributedAutonomousDatabaseShardDetailsOkvEndPointGroup,
 *         okvKeyStoreId: testKeyStore.id,
 *         peerCloudAutonomousVmClusterIds: distributedAutonomousDatabaseShardDetailsPeerCloudAutonomousVmClusterIds,
 *         peerDetails: [{
 *             cloudAutonomousVmClusterId: testCloudAutonomousVmCluster.id,
 *             fastStartFailOverLagLimitInSeconds: Number(distributedAutonomousDatabaseShardDetailsPeerDetailsFastStartFailOverLagLimitInSeconds),
 *             isAutomaticFailoverEnabled: distributedAutonomousDatabaseShardDetailsPeerDetailsIsAutomaticFailoverEnabled === "true",
 *             protectionMode: distributedAutonomousDatabaseShardDetailsPeerDetailsProtectionMode,
 *             standbyMaintenanceBufferInDays: Number(distributedAutonomousDatabaseShardDetailsPeerDetailsStandbyMaintenanceBufferInDays),
 *         }],
 *         shardSpace: distributedAutonomousDatabaseShardDetailsShardSpace,
 *         vaultId: testVault.id,
 *     }],
 *     shardingMethod: distributedAutonomousDatabaseShardingMethod,
 *     chunks: Number(distributedAutonomousDatabaseChunks),
 *     dbBackupConfig: {
 *         backupDestinationDetails: [{
 *             type: distributedAutonomousDatabaseDbBackupConfigBackupDestinationDetailsType,
 *             dbrsPolicyId: testPolicy.id,
 *             id: distributedAutonomousDatabaseDbBackupConfigBackupDestinationDetailsId,
 *             internetProxy: distributedAutonomousDatabaseDbBackupConfigBackupDestinationDetailsInternetProxy,
 *             isRemote: distributedAutonomousDatabaseDbBackupConfigBackupDestinationDetailsIsRemote === "true",
 *             remoteRegion: distributedAutonomousDatabaseDbBackupConfigBackupDestinationDetailsRemoteRegion,
 *             vpcPassword: distributedAutonomousDatabaseDbBackupConfigBackupDestinationDetailsVpcPassword,
 *             vpcUser: distributedAutonomousDatabaseDbBackupConfigBackupDestinationDetailsVpcUser,
 *         }],
 *         recoveryWindowInDays: Number(distributedAutonomousDatabaseDbBackupConfigRecoveryWindowInDays),
 *     },
 *     definedTags: {
 *         "foo-namespace.bar-key": "value",
 *     },
 *     freeformTags: {
 *         "bar-key": "value",
 *     },
 *     listenerPortTls: Number(distributedAutonomousDatabaseListenerPortTls),
 *     patchOperations: [{
 *         operation: distributedAutonomousDatabasePatchOperationsOperation,
 *         selection: distributedAutonomousDatabasePatchOperationsSelection,
 *         value: distributedAutonomousDatabasePatchOperationsValue,
 *     }],
 *     replicationFactor: Number(distributedAutonomousDatabaseReplicationFactor),
 *     replicationMethod: distributedAutonomousDatabaseReplicationMethod,
 *     replicationUnit: Number(distributedAutonomousDatabaseReplicationUnit),
 * });
 * ```
 *
 * ## Import
 *
 * DistributedAutonomousDatabases can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:oci/distributedDatabaseDistributedAutonomousDatabase:DistributedDatabaseDistributedAutonomousDatabase test_distributed_autonomous_database "id"
 * ```
 */
class DistributedDatabaseDistributedAutonomousDatabase extends pulumi.CustomResource {
    /**
     * Get an existing DistributedDatabaseDistributedAutonomousDatabase 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 DistributedDatabaseDistributedAutonomousDatabase(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:oci/distributedDatabaseDistributedAutonomousDatabase:DistributedDatabaseDistributedAutonomousDatabase';
    /**
     * Returns true if the given object is an instance of DistributedDatabaseDistributedAutonomousDatabase.  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'] === DistributedDatabaseDistributedAutonomousDatabase.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["caBundleId"] = state?.caBundleId;
            resourceInputs["catalogDetails"] = state?.catalogDetails;
            resourceInputs["certificateId"] = state?.certificateId;
            resourceInputs["changeDbBackupConfigTrigger"] = state?.changeDbBackupConfigTrigger;
            resourceInputs["characterSet"] = state?.characterSet;
            resourceInputs["chunks"] = state?.chunks;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["configureGsmWalletTrigger"] = state?.configureGsmWalletTrigger;
            resourceInputs["configureShardingIsRebalanceRequired"] = state?.configureShardingIsRebalanceRequired;
            resourceInputs["configureShardingTrigger"] = state?.configureShardingTrigger;
            resourceInputs["connectionStrings"] = state?.connectionStrings;
            resourceInputs["databaseVersion"] = state?.databaseVersion;
            resourceInputs["dbBackupConfig"] = state?.dbBackupConfig;
            resourceInputs["dbDeploymentType"] = state?.dbDeploymentType;
            resourceInputs["dbWorkload"] = state?.dbWorkload;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["downloadGsmCertificateSigningRequestTrigger"] = state?.downloadGsmCertificateSigningRequestTrigger;
            resourceInputs["downloadedGsmCsrPem"] = state?.downloadedGsmCsrPem;
            resourceInputs["effectiveReplicationUnit"] = state?.effectiveReplicationUnit;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["generateGsmCertificateSigningRequestTrigger"] = state?.generateGsmCertificateSigningRequestTrigger;
            resourceInputs["generateGsmCertificateSigningRequestTriggerCaBundleId"] = state?.generateGsmCertificateSigningRequestTriggerCaBundleId;
            resourceInputs["generateWalletDownloadedWalletContentLength"] = state?.generateWalletDownloadedWalletContentLength;
            resourceInputs["generateWalletDownloadedWalletEtag"] = state?.generateWalletDownloadedWalletEtag;
            resourceInputs["generateWalletDownloadedWalletLastModified"] = state?.generateWalletDownloadedWalletLastModified;
            resourceInputs["generateWalletDownloadedWalletZipBase64"] = state?.generateWalletDownloadedWalletZipBase64;
            resourceInputs["generateWalletPassword"] = state?.generateWalletPassword;
            resourceInputs["generateWalletTrigger"] = state?.generateWalletTrigger;
            resourceInputs["gsmDetails"] = state?.gsmDetails;
            resourceInputs["latestGsmImages"] = state?.latestGsmImages;
            resourceInputs["lifecycleDetails"] = state?.lifecycleDetails;
            resourceInputs["listenerPort"] = state?.listenerPort;
            resourceInputs["listenerPortTls"] = state?.listenerPortTls;
            resourceInputs["metadatas"] = state?.metadatas;
            resourceInputs["moveReplicationUnitTrigger"] = state?.moveReplicationUnitTrigger;
            resourceInputs["ncharacterSet"] = state?.ncharacterSet;
            resourceInputs["onsPortLocal"] = state?.onsPortLocal;
            resourceInputs["onsPortRemote"] = state?.onsPortRemote;
            resourceInputs["patchOperations"] = state?.patchOperations;
            resourceInputs["prefix"] = state?.prefix;
            resourceInputs["privateEndpointIds"] = state?.privateEndpointIds;
            resourceInputs["recreateFailedResourceTrigger"] = state?.recreateFailedResourceTrigger;
            resourceInputs["replicationFactor"] = state?.replicationFactor;
            resourceInputs["replicationMethod"] = state?.replicationMethod;
            resourceInputs["replicationUnit"] = state?.replicationUnit;
            resourceInputs["shardDetails"] = state?.shardDetails;
            resourceInputs["shardingMethod"] = state?.shardingMethod;
            resourceInputs["startDatabaseTrigger"] = state?.startDatabaseTrigger;
            resourceInputs["state"] = state?.state;
            resourceInputs["stopDatabaseTrigger"] = state?.stopDatabaseTrigger;
            resourceInputs["systemTags"] = state?.systemTags;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeUpdated"] = state?.timeUpdated;
            resourceInputs["uploadCaSignedCertificate"] = state?.uploadCaSignedCertificate;
            resourceInputs["uploadSignedCertificateAndGenerateWalletTrigger"] = state?.uploadSignedCertificateAndGenerateWalletTrigger;
            resourceInputs["validateCaBundleTrigger"] = state?.validateCaBundleTrigger;
            resourceInputs["validateNetworkDetails"] = state?.validateNetworkDetails;
            resourceInputs["validateNetworkTrigger"] = state?.validateNetworkTrigger;
        }
        else {
            const args = argsOrState;
            if (args?.catalogDetails === undefined && !opts.urn) {
                throw new Error("Missing required property 'catalogDetails'");
            }
            if (args?.characterSet === undefined && !opts.urn) {
                throw new Error("Missing required property 'characterSet'");
            }
            if (args?.compartmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'compartmentId'");
            }
            if (args?.databaseVersion === undefined && !opts.urn) {
                throw new Error("Missing required property 'databaseVersion'");
            }
            if (args?.dbDeploymentType === undefined && !opts.urn) {
                throw new Error("Missing required property 'dbDeploymentType'");
            }
            if (args?.dbWorkload === undefined && !opts.urn) {
                throw new Error("Missing required property 'dbWorkload'");
            }
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.listenerPort === undefined && !opts.urn) {
                throw new Error("Missing required property 'listenerPort'");
            }
            if (args?.ncharacterSet === undefined && !opts.urn) {
                throw new Error("Missing required property 'ncharacterSet'");
            }
            if (args?.onsPortLocal === undefined && !opts.urn) {
                throw new Error("Missing required property 'onsPortLocal'");
            }
            if (args?.onsPortRemote === undefined && !opts.urn) {
                throw new Error("Missing required property 'onsPortRemote'");
            }
            if (args?.prefix === undefined && !opts.urn) {
                throw new Error("Missing required property 'prefix'");
            }
            if (args?.privateEndpointIds === undefined && !opts.urn) {
                throw new Error("Missing required property 'privateEndpointIds'");
            }
            if (args?.shardDetails === undefined && !opts.urn) {
                throw new Error("Missing required property 'shardDetails'");
            }
            if (args?.shardingMethod === undefined && !opts.urn) {
                throw new Error("Missing required property 'shardingMethod'");
            }
            resourceInputs["caBundleId"] = args?.caBundleId;
            resourceInputs["catalogDetails"] = args?.catalogDetails;
            resourceInputs["certificateId"] = args?.certificateId;
            resourceInputs["changeDbBackupConfigTrigger"] = args?.changeDbBackupConfigTrigger;
            resourceInputs["characterSet"] = args?.characterSet;
            resourceInputs["chunks"] = args?.chunks;
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["configureGsmWalletTrigger"] = args?.configureGsmWalletTrigger;
            resourceInputs["configureShardingIsRebalanceRequired"] = args?.configureShardingIsRebalanceRequired;
            resourceInputs["configureShardingTrigger"] = args?.configureShardingTrigger;
            resourceInputs["databaseVersion"] = args?.databaseVersion;
            resourceInputs["dbBackupConfig"] = args?.dbBackupConfig;
            resourceInputs["dbDeploymentType"] = args?.dbDeploymentType;
            resourceInputs["dbWorkload"] = args?.dbWorkload;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["downloadGsmCertificateSigningRequestTrigger"] = args?.downloadGsmCertificateSigningRequestTrigger;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["generateGsmCertificateSigningRequestTrigger"] = args?.generateGsmCertificateSigningRequestTrigger;
            resourceInputs["generateGsmCertificateSigningRequestTriggerCaBundleId"] = args?.generateGsmCertificateSigningRequestTriggerCaBundleId;
            resourceInputs["generateWalletPassword"] = args?.generateWalletPassword ? pulumi.secret(args.generateWalletPassword) : undefined;
            resourceInputs["generateWalletTrigger"] = args?.generateWalletTrigger;
            resourceInputs["listenerPort"] = args?.listenerPort;
            resourceInputs["listenerPortTls"] = args?.listenerPortTls;
            resourceInputs["moveReplicationUnitTrigger"] = args?.moveReplicationUnitTrigger;
            resourceInputs["ncharacterSet"] = args?.ncharacterSet;
            resourceInputs["onsPortLocal"] = args?.onsPortLocal;
            resourceInputs["onsPortRemote"] = args?.onsPortRemote;
            resourceInputs["patchOperations"] = args?.patchOperations;
            resourceInputs["prefix"] = args?.prefix;
            resourceInputs["privateEndpointIds"] = args?.privateEndpointIds;
            resourceInputs["recreateFailedResourceTrigger"] = args?.recreateFailedResourceTrigger;
            resourceInputs["replicationFactor"] = args?.replicationFactor;
            resourceInputs["replicationMethod"] = args?.replicationMethod;
            resourceInputs["replicationUnit"] = args?.replicationUnit;
            resourceInputs["shardDetails"] = args?.shardDetails;
            resourceInputs["shardingMethod"] = args?.shardingMethod;
            resourceInputs["startDatabaseTrigger"] = args?.startDatabaseTrigger;
            resourceInputs["state"] = args?.state;
            resourceInputs["stopDatabaseTrigger"] = args?.stopDatabaseTrigger;
            resourceInputs["uploadCaSignedCertificate"] = args?.uploadCaSignedCertificate ? pulumi.secret(args.uploadCaSignedCertificate) : undefined;
            resourceInputs["uploadSignedCertificateAndGenerateWalletTrigger"] = args?.uploadSignedCertificateAndGenerateWalletTrigger;
            resourceInputs["validateCaBundleTrigger"] = args?.validateCaBundleTrigger;
            resourceInputs["validateNetworkDetails"] = args?.validateNetworkDetails;
            resourceInputs["validateNetworkTrigger"] = args?.validateNetworkTrigger;
            resourceInputs["connectionStrings"] = undefined /*out*/;
            resourceInputs["downloadedGsmCsrPem"] = undefined /*out*/;
            resourceInputs["effectiveReplicationUnit"] = undefined /*out*/;
            resourceInputs["generateWalletDownloadedWalletContentLength"] = undefined /*out*/;
            resourceInputs["generateWalletDownloadedWalletEtag"] = undefined /*out*/;
            resourceInputs["generateWalletDownloadedWalletLastModified"] = undefined /*out*/;
            resourceInputs["generateWalletDownloadedWalletZipBase64"] = undefined /*out*/;
            resourceInputs["gsmDetails"] = undefined /*out*/;
            resourceInputs["latestGsmImages"] = undefined /*out*/;
            resourceInputs["lifecycleDetails"] = undefined /*out*/;
            resourceInputs["metadatas"] = undefined /*out*/;
            resourceInputs["systemTags"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["timeUpdated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["downloadedGsmCsrPem", "generateWalletDownloadedWalletZipBase64", "generateWalletPassword", "uploadCaSignedCertificate"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(DistributedDatabaseDistributedAutonomousDatabase.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DistributedDatabaseDistributedAutonomousDatabase = DistributedDatabaseDistributedAutonomousDatabase;
//# sourceMappingURL=distributedDatabaseDistributedAutonomousDatabase.js.map