"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.GeoReplication = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages Managed Redis Geo-Replication by linking and unlinking databases in a geo-replication group.
 *
 * > **Note:** This resource manages the geo-replication group membership for Managed Redis databases. All databases to be linked must have `geoReplicationGroupName` provided with the same value. Linking will [discard cache data and cause temporary outage](https://learn.microsoft.com/azure/redis/how-to-active-geo-replication#add-an-existing-instance-to-an-active-geo-replication-group).
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-managedredis",
 *     location: "West Europe",
 * });
 * const amr1 = new azure.managedredis.ManagedRedis("amr1", {
 *     name: "example-managedredis-amr1",
 *     resourceGroupName: example.name,
 *     location: "West Europe",
 *     skuName: "Balanced_B3",
 *     defaultDatabase: {
 *         geoReplicationGroupName: "example-geo-group",
 *     },
 * });
 * const amr2 = new azure.managedredis.ManagedRedis("amr2", {
 *     name: "example-managedredis-amr2",
 *     resourceGroupName: example.name,
 *     location: "Central US",
 *     skuName: "Balanced_B3",
 *     defaultDatabase: {
 *         geoReplicationGroupName: "example-geo-group",
 *     },
 * });
 * const exampleGeoReplication = new azure.managedredis.GeoReplication("example", {
 *     managedRedisId: amr1.id,
 *     linkedManagedRedisIds: [amr2.id],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Cache` - 2025-07-01
 *
 * ## Import
 *
 * Managed Redis Database Geo-Replication can be imported using the Managed Redis `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:managedredis/geoReplication:GeoReplication example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Cache/redisEnterprise/cluster1
 * ```
 */
class GeoReplication extends pulumi.CustomResource {
    /**
     * Get an existing GeoReplication 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 GeoReplication(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:managedredis/geoReplication:GeoReplication';
    /**
     * Returns true if the given object is an instance of GeoReplication.  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'] === GeoReplication.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["linkedManagedRedisIds"] = state?.linkedManagedRedisIds;
            resourceInputs["managedRedisId"] = state?.managedRedisId;
        }
        else {
            const args = argsOrState;
            if (args?.linkedManagedRedisIds === undefined && !opts.urn) {
                throw new Error("Missing required property 'linkedManagedRedisIds'");
            }
            if (args?.managedRedisId === undefined && !opts.urn) {
                throw new Error("Missing required property 'managedRedisId'");
            }
            resourceInputs["linkedManagedRedisIds"] = args?.linkedManagedRedisIds;
            resourceInputs["managedRedisId"] = args?.managedRedisId;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(GeoReplication.__pulumiType, name, resourceInputs, opts);
    }
}
exports.GeoReplication = GeoReplication;
//# sourceMappingURL=geoReplication.js.map