"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.ManagedRedis = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a [Managed Redis](https://learn.microsoft.com/azure/redis/overview). This resource supersedes azure.redis.EnterpriseCluster and azure.redis.EnterpriseDatabase resources. Please refer to the migration guide for more information on migrating from Redis Enterprise to Managed Redis: [Migrating from Redis Enterprise to Managed Redis](https://learn.microsoft.com/azure/redis/migrate/migrate-overview).
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleManagedRedis = new azure.managedredis.ManagedRedis("example", {
 *     name: "example-managed-redis",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     skuName: "Balanced_B3",
 *     defaultDatabase: {
 *         geoReplicationGroupName: "myGeoGroup",
 *     },
 * });
 * ```
 *
 * ### With Customer Managed Key
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const current = azure.core.getClientConfig({});
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     location: example.location,
 * });
 * const exampleKeyVault = new azure.keyvault.KeyVault("example", {
 *     name: "example",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     tenantId: current.then(current => current.tenantId),
 *     skuName: "standard",
 *     purgeProtectionEnabled: true,
 *     accessPolicies: [
 *         {
 *             tenantId: current.then(current => current.tenantId),
 *             objectId: current.then(current => current.objectId),
 *             keyPermissions: [
 *                 "Create",
 *                 "Delete",
 *                 "Get",
 *                 "List",
 *                 "Purge",
 *                 "Recover",
 *                 "Update",
 *                 "GetRotationPolicy",
 *                 "SetRotationPolicy",
 *             ],
 *         },
 *         {
 *             tenantId: current.then(current => current.tenantId),
 *             objectId: exampleUserAssignedIdentity.principalId,
 *             keyPermissions: [
 *                 "Get",
 *                 "WrapKey",
 *                 "UnwrapKey",
 *             ],
 *         },
 *     ],
 * });
 * const exampleKey = new azure.keyvault.Key("example", {
 *     name: "managedrediscmk",
 *     keyVaultId: exampleKeyVault.id,
 *     keyType: "RSA",
 *     keySize: 2048,
 *     keyOpts: [
 *         "unwrapKey",
 *         "wrapKey",
 *     ],
 * });
 * const exampleManagedRedis = new azure.managedredis.ManagedRedis("example", {
 *     name: "example-managed-redis",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     skuName: "Balanced_B3",
 *     identity: {
 *         type: "UserAssigned",
 *         identityIds: [exampleUserAssignedIdentity.id],
 *     },
 *     customerManagedKey: {
 *         keyVaultKeyId: exampleKey.id,
 *         userAssignedIdentityId: exampleUserAssignedIdentity.id,
 *     },
 *     defaultDatabase: {
 *         geoReplicationGroupName: "myGeoGroup",
 *     },
 * });
 * ```
 *
 * ## 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 instances can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:managedredis/managedRedis:ManagedRedis example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Cache/redisEnterprise/cluster1
 * ```
 */
class ManagedRedis extends pulumi.CustomResource {
    /**
     * Get an existing ManagedRedis 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 ManagedRedis(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:managedredis/managedRedis:ManagedRedis';
    /**
     * Returns true if the given object is an instance of ManagedRedis.  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'] === ManagedRedis.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["customerManagedKey"] = state?.customerManagedKey;
            resourceInputs["defaultDatabase"] = state?.defaultDatabase;
            resourceInputs["highAvailabilityEnabled"] = state?.highAvailabilityEnabled;
            resourceInputs["hostname"] = state?.hostname;
            resourceInputs["identity"] = state?.identity;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["publicNetworkAccess"] = state?.publicNetworkAccess;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["skuName"] = state?.skuName;
            resourceInputs["tags"] = state?.tags;
        }
        else {
            const args = argsOrState;
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.skuName === undefined && !opts.urn) {
                throw new Error("Missing required property 'skuName'");
            }
            resourceInputs["customerManagedKey"] = args?.customerManagedKey;
            resourceInputs["defaultDatabase"] = args?.defaultDatabase;
            resourceInputs["highAvailabilityEnabled"] = args?.highAvailabilityEnabled;
            resourceInputs["identity"] = args?.identity;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["publicNetworkAccess"] = args?.publicNetworkAccess;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["skuName"] = args?.skuName;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["hostname"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ManagedRedis.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ManagedRedis = ManagedRedis;
//# sourceMappingURL=managedRedis.js.map