"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.DataGuardAssociation = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Data Guard Association resource in Oracle Cloud Infrastructure Database service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/database/latest/DataGuardAssociation
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/database
 *
 * Creates a new Data Guard association.  A Data Guard association represents the replication relationship between the
 * specified database and a peer database. For more information, see [Using Oracle Data Guard](https://docs.cloud.oracle.com/iaas/Content/Database/Tasks/usingdataguard.htm).
 *
 * All Oracle Cloud Infrastructure resources, including Data Guard associations, get an Oracle-assigned, unique ID
 * called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response.
 * You can also retrieve a resource's OCID by using a List API operation on that resource type, or by viewing the
 * resource in the Console. For more information, see
 * [Resource Identifiers](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testDataGuardAssociation = new oci.database.DataGuardAssociation("test_data_guard_association", {
 *     creationType: dataGuardAssociationCreationType,
 *     databaseAdminPassword: dataGuardAssociationDatabaseAdminPassword,
 *     databaseId: testDatabase.id,
 *     deleteStandbyDbHomeOnDelete: dataGuardAssociationDeleteStandbyDbHomeOnDelete,
 *     protectionMode: dataGuardAssociationProtectionMode,
 *     transportType: dataGuardAssociationTransportType,
 *     availabilityDomain: dataGuardAssociationAvailabilityDomain,
 *     backupNetworkNsgIds: dataGuardAssociationBackupNetworkNsgIds,
 *     computeCount: Number(dataGuardAssociationComputeCount),
 *     computeModel: dataGuardAssociationComputeModel,
 *     cpuCoreCount: Number(dataGuardAssociationCpuCoreCount),
 *     databaseDefinedTags: dataGuardAssociationDatabaseDefinedTags,
 *     databaseFreeformTags: dataGuardAssociationDatabaseFreeformTags,
 *     dataCollectionOptions: {
 *         isDiagnosticsEventsEnabled: dataGuardAssociationDataCollectionOptionsIsDiagnosticsEventsEnabled === "true",
 *         isHealthMonitoringEnabled: dataGuardAssociationDataCollectionOptionsIsHealthMonitoringEnabled === "true",
 *         isIncidentLogsEnabled: dataGuardAssociationDataCollectionOptionsIsIncidentLogsEnabled === "true",
 *     },
 *     databaseSoftwareImageId: testDatabaseSoftwareImage.id,
 *     dbSystemDefinedTags: dataGuardAssociationDbSystemDefinedTags,
 *     dbSystemFreeformTags: dataGuardAssociationDbSystemFreeformTags,
 *     dbSystemSecurityAttributes: dataGuardAssociationDbSystemSecurityAttributes,
 *     displayName: dataGuardAssociationDisplayName,
 *     domain: dataGuardAssociationDomain,
 *     faultDomains: dataGuardAssociationFaultDomains,
 *     hostname: dataGuardAssociationHostname,
 *     isActiveDataGuardEnabled: dataGuardAssociationIsActiveDataGuardEnabled === "true",
 *     licenseModel: dataGuardAssociationLicenseModel,
 *     nodeCount: Number(dataGuardAssociationNodeCount),
 *     nsgIds: dataGuardAssociationNsgIds,
 *     peerDbHomeId: testDbHome.id,
 *     peerDbSystemId: testDbSystem.id,
 *     peerDbUniqueName: dataGuardAssociationPeerDbUniqueName,
 *     peerSidPrefix: dataGuardAssociationPeerSidPrefix,
 *     peerVmClusterId: testVmCluster.id,
 *     privateIp: dataGuardAssociationPrivateIp,
 *     privateIpV6: dataGuardAssociationPrivateIpV6,
 *     shape: dataGuardAssociationShape,
 *     storageVolumePerformanceMode: dataGuardAssociationStorageVolumePerformanceMode,
 *     subnetId: testSubnet.id,
 *     timeZone: dataGuardAssociationTimeZone,
 * });
 * ```
 *
 * ## Import
 *
 * Import is not supported for this resource.
 */
class DataGuardAssociation extends pulumi.CustomResource {
    /**
     * Get an existing DataGuardAssociation 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 DataGuardAssociation(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Database/dataGuardAssociation:DataGuardAssociation';
    /**
     * Returns true if the given object is an instance of DataGuardAssociation.  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'] === DataGuardAssociation.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["applyLag"] = state?.applyLag;
            resourceInputs["applyRate"] = state?.applyRate;
            resourceInputs["availabilityDomain"] = state?.availabilityDomain;
            resourceInputs["backupNetworkNsgIds"] = state?.backupNetworkNsgIds;
            resourceInputs["clusterPlacementGroupId"] = state?.clusterPlacementGroupId;
            resourceInputs["computeCount"] = state?.computeCount;
            resourceInputs["computeModel"] = state?.computeModel;
            resourceInputs["cpuCoreCount"] = state?.cpuCoreCount;
            resourceInputs["createAsync"] = state?.createAsync;
            resourceInputs["creationType"] = state?.creationType;
            resourceInputs["dataCollectionOptions"] = state?.dataCollectionOptions;
            resourceInputs["databaseAdminPassword"] = state?.databaseAdminPassword;
            resourceInputs["databaseDefinedTags"] = state?.databaseDefinedTags;
            resourceInputs["databaseFreeformTags"] = state?.databaseFreeformTags;
            resourceInputs["databaseId"] = state?.databaseId;
            resourceInputs["databaseSoftwareImageId"] = state?.databaseSoftwareImageId;
            resourceInputs["dbSystemDefinedTags"] = state?.dbSystemDefinedTags;
            resourceInputs["dbSystemFreeformTags"] = state?.dbSystemFreeformTags;
            resourceInputs["dbSystemSecurityAttributes"] = state?.dbSystemSecurityAttributes;
            resourceInputs["deleteStandbyDbHomeOnDelete"] = state?.deleteStandbyDbHomeOnDelete;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["domain"] = state?.domain;
            resourceInputs["faultDomains"] = state?.faultDomains;
            resourceInputs["hostname"] = state?.hostname;
            resourceInputs["isActiveDataGuardEnabled"] = state?.isActiveDataGuardEnabled;
            resourceInputs["licenseModel"] = state?.licenseModel;
            resourceInputs["lifecycleDetails"] = state?.lifecycleDetails;
            resourceInputs["migrateTrigger"] = state?.migrateTrigger;
            resourceInputs["nodeCount"] = state?.nodeCount;
            resourceInputs["nsgIds"] = state?.nsgIds;
            resourceInputs["peerDataGuardAssociationId"] = state?.peerDataGuardAssociationId;
            resourceInputs["peerDatabaseId"] = state?.peerDatabaseId;
            resourceInputs["peerDbHomeId"] = state?.peerDbHomeId;
            resourceInputs["peerDbSystemId"] = state?.peerDbSystemId;
            resourceInputs["peerDbUniqueName"] = state?.peerDbUniqueName;
            resourceInputs["peerRole"] = state?.peerRole;
            resourceInputs["peerSidPrefix"] = state?.peerSidPrefix;
            resourceInputs["peerVmClusterId"] = state?.peerVmClusterId;
            resourceInputs["privateIp"] = state?.privateIp;
            resourceInputs["privateIpV6"] = state?.privateIpV6;
            resourceInputs["protectionMode"] = state?.protectionMode;
            resourceInputs["role"] = state?.role;
            resourceInputs["shape"] = state?.shape;
            resourceInputs["state"] = state?.state;
            resourceInputs["storageVolumePerformanceMode"] = state?.storageVolumePerformanceMode;
            resourceInputs["subnetId"] = state?.subnetId;
            resourceInputs["subscriptionId"] = state?.subscriptionId;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeZone"] = state?.timeZone;
            resourceInputs["transportType"] = state?.transportType;
        }
        else {
            const args = argsOrState;
            if (args?.creationType === undefined && !opts.urn) {
                throw new Error("Missing required property 'creationType'");
            }
            if (args?.databaseAdminPassword === undefined && !opts.urn) {
                throw new Error("Missing required property 'databaseAdminPassword'");
            }
            if (args?.databaseId === undefined && !opts.urn) {
                throw new Error("Missing required property 'databaseId'");
            }
            if (args?.deleteStandbyDbHomeOnDelete === undefined && !opts.urn) {
                throw new Error("Missing required property 'deleteStandbyDbHomeOnDelete'");
            }
            if (args?.protectionMode === undefined && !opts.urn) {
                throw new Error("Missing required property 'protectionMode'");
            }
            if (args?.transportType === undefined && !opts.urn) {
                throw new Error("Missing required property 'transportType'");
            }
            resourceInputs["availabilityDomain"] = args?.availabilityDomain;
            resourceInputs["backupNetworkNsgIds"] = args?.backupNetworkNsgIds;
            resourceInputs["clusterPlacementGroupId"] = args?.clusterPlacementGroupId;
            resourceInputs["computeCount"] = args?.computeCount;
            resourceInputs["computeModel"] = args?.computeModel;
            resourceInputs["cpuCoreCount"] = args?.cpuCoreCount;
            resourceInputs["createAsync"] = args?.createAsync;
            resourceInputs["creationType"] = args?.creationType;
            resourceInputs["dataCollectionOptions"] = args?.dataCollectionOptions;
            resourceInputs["databaseAdminPassword"] = args?.databaseAdminPassword ? pulumi.secret(args.databaseAdminPassword) : undefined;
            resourceInputs["databaseDefinedTags"] = args?.databaseDefinedTags;
            resourceInputs["databaseFreeformTags"] = args?.databaseFreeformTags;
            resourceInputs["databaseId"] = args?.databaseId;
            resourceInputs["databaseSoftwareImageId"] = args?.databaseSoftwareImageId;
            resourceInputs["dbSystemDefinedTags"] = args?.dbSystemDefinedTags;
            resourceInputs["dbSystemFreeformTags"] = args?.dbSystemFreeformTags;
            resourceInputs["dbSystemSecurityAttributes"] = args?.dbSystemSecurityAttributes;
            resourceInputs["deleteStandbyDbHomeOnDelete"] = args?.deleteStandbyDbHomeOnDelete;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["domain"] = args?.domain;
            resourceInputs["faultDomains"] = args?.faultDomains;
            resourceInputs["hostname"] = args?.hostname;
            resourceInputs["isActiveDataGuardEnabled"] = args?.isActiveDataGuardEnabled;
            resourceInputs["licenseModel"] = args?.licenseModel;
            resourceInputs["migrateTrigger"] = args?.migrateTrigger;
            resourceInputs["nodeCount"] = args?.nodeCount;
            resourceInputs["nsgIds"] = args?.nsgIds;
            resourceInputs["peerDbHomeId"] = args?.peerDbHomeId;
            resourceInputs["peerDbSystemId"] = args?.peerDbSystemId;
            resourceInputs["peerDbUniqueName"] = args?.peerDbUniqueName;
            resourceInputs["peerSidPrefix"] = args?.peerSidPrefix;
            resourceInputs["peerVmClusterId"] = args?.peerVmClusterId;
            resourceInputs["privateIp"] = args?.privateIp;
            resourceInputs["privateIpV6"] = args?.privateIpV6;
            resourceInputs["protectionMode"] = args?.protectionMode;
            resourceInputs["shape"] = args?.shape;
            resourceInputs["storageVolumePerformanceMode"] = args?.storageVolumePerformanceMode;
            resourceInputs["subnetId"] = args?.subnetId;
            resourceInputs["subscriptionId"] = args?.subscriptionId;
            resourceInputs["timeZone"] = args?.timeZone;
            resourceInputs["transportType"] = args?.transportType;
            resourceInputs["applyLag"] = undefined /*out*/;
            resourceInputs["applyRate"] = undefined /*out*/;
            resourceInputs["lifecycleDetails"] = undefined /*out*/;
            resourceInputs["peerDataGuardAssociationId"] = undefined /*out*/;
            resourceInputs["peerDatabaseId"] = undefined /*out*/;
            resourceInputs["peerRole"] = undefined /*out*/;
            resourceInputs["role"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["databaseAdminPassword"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(DataGuardAssociation.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DataGuardAssociation = DataGuardAssociation;
//# sourceMappingURL=dataGuardAssociation.js.map