"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.DrProtectionGroup = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Dr Protection Group resource in Oracle Cloud Infrastructure Disaster Recovery service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/disaster-recovery/latest/DrProtectionGroup
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/disaster_recovery
 *
 * Create a DR protection group.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const config = new pulumi.Config();
 * const disassociateTrigger = config.getNumber("disassociateTrigger") || 0;
 * const testDrProtectionGroup = new oci.disasterrecovery.DrProtectionGroup("test_dr_protection_group", {
 *     compartmentId: compartmentId,
 *     displayName: drProtectionGroupDisplayName,
 *     logLocation: {
 *         bucket: drProtectionGroupLogLocationBucket,
 *         namespace: drProtectionGroupLogLocationNamespace,
 *     },
 *     association: {
 *         role: drProtectionGroupAssociationRole,
 *         peerId: drProtectionGroupAssociationPeerId,
 *         peerRegion: drProtectionGroupAssociationPeerRegion,
 *     },
 *     definedTags: {
 *         "Operations.CostCenter": "42",
 *     },
 *     freeformTags: {
 *         Department: "Finance",
 *     },
 *     disassociateTrigger: disassociateTrigger,
 *     members: [{
 *         memberId: drProtectionGroupMembersMemberId,
 *         memberType: drProtectionGroupMembersMemberType,
 *         autonomousDatabaseStandbyTypeForDrDrills: drProtectionGroupMembersAutonomousDatabaseStandbyTypeForDrDrills,
 *         backendSetMappings: [{
 *             destinationBackendSetName: testBackendSet.name,
 *             isBackendSetForNonMovable: drProtectionGroupMembersBackendSetMappingsIsBackendSetForNonMovable === "true",
 *             sourceBackendSetName: testBackendSet.name,
 *         }],
 *         backupConfig: {
 *             backupSchedule: drProtectionGroupMembersBackupConfigBackupSchedule,
 *             excludeNamespaces: drProtectionGroupMembersBackupConfigExcludeNamespaces,
 *             imageReplicationVaultSecretId: testSecret.id,
 *             maxNumberOfBackupsRetained: Number(drProtectionGroupMembersBackupConfigMaxNumberOfBackupsRetained),
 *             namespaces: drProtectionGroupMembersBackupConfigNamespaces,
 *             replicateImages: drProtectionGroupMembersBackupConfigReplicateImages,
 *         },
 *         backupLocation: {
 *             bucket: drProtectionGroupMembersBackupLocationBucket,
 *             namespace: drProtectionGroupMembersBackupLocationNamespace,
 *         },
 *         blockVolumeAttachAndMountOperations: {
 *             attachments: [{
 *                 blockVolumeId: testVolume.id,
 *                 volumeAttachmentReferenceInstanceId: testInstance.id,
 *             }],
 *             mounts: [{
 *                 mountPoint: drProtectionGroupMembersBlockVolumeAttachAndMountOperationsMountsMountPoint,
 *             }],
 *         },
 *         blockVolumeOperations: [{
 *             attachmentDetails: {
 *                 volumeAttachmentReferenceInstanceId: testInstance.id,
 *             },
 *             blockVolumeId: testVolume.id,
 *             mountDetails: {
 *                 mountPoint: drProtectionGroupMembersBlockVolumeOperationsMountDetailsMountPoint,
 *             },
 *         }],
 *         bucket: drProtectionGroupMembersBucket,
 *         commonDestinationKey: {
 *             encryptionKeyId: testKey.id,
 *             vaultId: testVault.id,
 *         },
 *         connectionStringType: drProtectionGroupMembersConnectionStringType,
 *         dbSystemAdminUserDetails: {
 *             passwordVaultSecretId: testSecret.id,
 *             username: drProtectionGroupMembersDbSystemAdminUserDetailsUsername,
 *         },
 *         dbSystemReplicationUserDetails: {
 *             passwordVaultSecretId: testSecret.id,
 *             username: drProtectionGroupMembersDbSystemReplicationUserDetailsUsername,
 *         },
 *         destinationAvailabilityDomain: drProtectionGroupMembersDestinationAvailabilityDomain,
 *         destinationBackupPolicyId: testPolicy.id,
 *         destinationCapacityReservationId: destinationCapacityReservationId,
 *         destinationCompartmentId: testCompartment.id,
 *         destinationDedicatedVmHostId: testDedicatedVmHost.id,
 *         destinationEncryptionKey: {
 *             encryptionKeyId: testKey.id,
 *             vaultId: testVault.id,
 *         },
 *         destinationLoadBalancerId: testLoadBalancer.id,
 *         destinationNetworkLoadBalancerId: testNetworkLoadBalancer.id,
 *         destinationSnapshotPolicyId: testPolicy.id,
 *         exportMappings: [{
 *             destinationMountTargetId: testMountTarget.id,
 *             exportId: testExport.id,
 *         }],
 *         fileSystemOperations: [{
 *             exportPath: drProtectionGroupMembersFileSystemOperationsExportPath,
 *             mountDetails: {
 *                 mountTargetId: testMountTarget.id,
 *             },
 *             mountPoint: drProtectionGroupMembersFileSystemOperationsMountPoint,
 *             mountTargetId: testMountTarget.id,
 *             unmountDetails: {
 *                 mountTargetId: testMountTarget.id,
 *             },
 *         }],
 *         gtidReconciliationTimeout: Number(drProtectionGroupMembersGtidReconciliationTimeout),
 *         isContinueOnGtidReconciliationTimeout: drProtectionGroupMembersIsContinueOnGtidReconciliationTimeout === "true",
 *         isMovable: drProtectionGroupMembersIsMovable === "true",
 *         isRetainFaultDomain: drProtectionGroupMembersIsRetainFaultDomain === "true",
 *         isStartStopEnabled: drProtectionGroupMembersIsStartStopEnabled === "true",
 *         jumpHostId: testJumpHost.id,
 *         loadBalancerMappings: [{
 *             destinationLoadBalancerId: testLoadBalancer.id,
 *             sourceLoadBalancerId: testLoadBalancer.id,
 *         }],
 *         managedNodePoolConfigs: [{
 *             id: drProtectionGroupMembersManagedNodePoolConfigsId,
 *             maximum: Number(drProtectionGroupMembersManagedNodePoolConfigsMaximum),
 *             minimum: Number(drProtectionGroupMembersManagedNodePoolConfigsMinimum),
 *         }],
 *         namespace: drProtectionGroupMembersNamespace,
 *         passwordVaultSecretId: passwordVaultSecretId,
 *         networkLoadBalancerMappings: [{
 *             destinationNetworkLoadBalancerId: testNetworkLoadBalancer.id,
 *             sourceNetworkLoadBalancerId: testNetworkLoadBalancer.id,
 *         }],
 *         peerClusterId: testCluster.id,
 *         peerDbSystemId: testDbSystem.id,
 *         resourceModifierMappings: [{
 *             configMap: drProtectionGroupMembersResourceModifierMappingsConfigMap,
 *             namespace: drProtectionGroupMembersResourceModifierMappingsNamespace,
 *         }],
 *         sourceVolumeToDestinationEncryptionKeyMappings: [{
 *             destinationEncryptionKey: {
 *                 encryptionKeyId: testKey.id,
 *                 vaultId: testVault.id,
 *             },
 *             sourceVolumeId: testVolume.id,
 *         }],
 *         vaultMappings: [{
 *             destinationVaultId: testVault.id,
 *             sourceVaultId: testVault.id,
 *         }],
 *         virtualNodePoolConfigs: [{
 *             id: drProtectionGroupMembersVirtualNodePoolConfigsId,
 *             maximum: Number(drProtectionGroupMembersVirtualNodePoolConfigsMaximum),
 *             minimum: Number(drProtectionGroupMembersVirtualNodePoolConfigsMinimum),
 *         }],
 *         vnicMappings: [
 *             {
 *                 destinationNsgIdLists: drProtectionGroupMembersVnicMappingDestinationNsgIdList,
 *                 destinationPrimaryPrivateIpAddress: drProtectionGroupMembersVnicMappingDestinationPrimaryPrivateIpAddress,
 *                 destinationPrimaryPrivateIpHostnameLabel: drProtectionGroupMembersVnicMappingDestinationPrimaryPrivateIpHostnameLabel,
 *                 destinationSubnetId: testSubnet.id,
 *                 sourceVnicId: testVnic.id,
 *             },
 *             {
 *                 destinationNsgIdLists: drProtectionGroupMembersVnicMappingsDestinationNsgIdList,
 *                 destinationPrimaryPrivateIpAddress: drProtectionGroupMembersVnicMappingsDestinationPrimaryPrivateIpAddress,
 *                 destinationPrimaryPrivateIpHostnameLabel: drProtectionGroupMembersVnicMappingsDestinationPrimaryPrivateIpHostnameLabel,
 *                 destinationReservedPublicIpId: testPublicIp.id,
 *                 destinationSubnetId: testSubnet.id,
 *                 sourceVnicId: testVnic.id,
 *             },
 *         ],
 *     }],
 * });
 * ```
 *
 * ## Create
 *
 * Create DR Protection Group resource with a default value of `disassociateTrigger` property, e.g.
 *
 * ## Delete
 *
 * Disassociate DR Protection Group (if associated) before deleting it. Increment value of `disassociateTrigger` property to trigger Disassociate, e.g.
 *
 * ## Import
 *
 * DrProtectionGroups can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:DisasterRecovery/drProtectionGroup:DrProtectionGroup test_dr_protection_group "id"
 * ```
 */
class DrProtectionGroup extends pulumi.CustomResource {
    /**
     * Get an existing DrProtectionGroup 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 DrProtectionGroup(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:DisasterRecovery/drProtectionGroup:DrProtectionGroup';
    /**
     * Returns true if the given object is an instance of DrProtectionGroup.  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'] === DrProtectionGroup.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["association"] = state?.association;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["disassociateTrigger"] = state?.disassociateTrigger;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["lifeCycleDetails"] = state?.lifeCycleDetails;
            resourceInputs["lifecycleSubState"] = state?.lifecycleSubState;
            resourceInputs["logLocation"] = state?.logLocation;
            resourceInputs["members"] = state?.members;
            resourceInputs["peerId"] = state?.peerId;
            resourceInputs["peerRegion"] = state?.peerRegion;
            resourceInputs["role"] = state?.role;
            resourceInputs["state"] = state?.state;
            resourceInputs["systemTags"] = state?.systemTags;
            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?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.logLocation === undefined && !opts.urn) {
                throw new Error("Missing required property 'logLocation'");
            }
            resourceInputs["association"] = args?.association;
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["disassociateTrigger"] = args?.disassociateTrigger;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["logLocation"] = args?.logLocation;
            resourceInputs["members"] = args?.members;
            resourceInputs["lifeCycleDetails"] = undefined /*out*/;
            resourceInputs["lifecycleSubState"] = undefined /*out*/;
            resourceInputs["peerId"] = undefined /*out*/;
            resourceInputs["peerRegion"] = undefined /*out*/;
            resourceInputs["role"] = 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(DrProtectionGroup.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DrProtectionGroup = DrProtectionGroup;
//# sourceMappingURL=drProtectionGroup.js.map