"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.Cache = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Redis Cache.
 *
 * > **Note:** Redis version 4 is being retired and no longer supports creating new instances. Version 4 will be removed in a future release. [Redis Version 4 Retirement](https://learn.microsoft.com/azure/azure-cache-for-redis/cache-retired-features#important-upgrade-timelines)
 *
 * ## Example Usage
 *
 * This example provisions a Standard Redis Cache.
 *
 * ```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",
 * });
 * // NOTE: the Name used for Redis needs to be globally unique
 * const exampleCache = new azure.redis.Cache("example", {
 *     name: "example-cache",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     capacity: 2,
 *     family: "C",
 *     skuName: "Standard",
 *     nonSslPortEnabled: false,
 *     minimumTlsVersion: "1.2",
 *     redisConfiguration: {},
 * });
 * ```
 *
 * ## Relevant Links
 *
 * * [Azure Cache for Redis planning](https://docs.microsoft.com/azure/azure-cache-for-redis/cache-planning-faq)
 * * [Redis: Available Configuration Settings](https://redis.io/topics/config)
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Cache` - 2024-11-01
 *
 * ## Import
 *
 * Redis Cache's can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:redis/cache:Cache cache1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Cache/redis/cache1
 * ```
 */
class Cache extends pulumi.CustomResource {
    /**
     * Get an existing Cache 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 Cache(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:redis/cache:Cache';
    /**
     * Returns true if the given object is an instance of Cache.  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'] === Cache.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accessKeysAuthenticationEnabled"] = state?.accessKeysAuthenticationEnabled;
            resourceInputs["capacity"] = state?.capacity;
            resourceInputs["family"] = state?.family;
            resourceInputs["hostname"] = state?.hostname;
            resourceInputs["identity"] = state?.identity;
            resourceInputs["location"] = state?.location;
            resourceInputs["minimumTlsVersion"] = state?.minimumTlsVersion;
            resourceInputs["name"] = state?.name;
            resourceInputs["nonSslPortEnabled"] = state?.nonSslPortEnabled;
            resourceInputs["patchSchedules"] = state?.patchSchedules;
            resourceInputs["port"] = state?.port;
            resourceInputs["primaryAccessKey"] = state?.primaryAccessKey;
            resourceInputs["primaryConnectionString"] = state?.primaryConnectionString;
            resourceInputs["privateStaticIpAddress"] = state?.privateStaticIpAddress;
            resourceInputs["publicNetworkAccessEnabled"] = state?.publicNetworkAccessEnabled;
            resourceInputs["redisConfiguration"] = state?.redisConfiguration;
            resourceInputs["redisVersion"] = state?.redisVersion;
            resourceInputs["replicasPerMaster"] = state?.replicasPerMaster;
            resourceInputs["replicasPerPrimary"] = state?.replicasPerPrimary;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["secondaryAccessKey"] = state?.secondaryAccessKey;
            resourceInputs["secondaryConnectionString"] = state?.secondaryConnectionString;
            resourceInputs["shardCount"] = state?.shardCount;
            resourceInputs["skuName"] = state?.skuName;
            resourceInputs["sslPort"] = state?.sslPort;
            resourceInputs["subnetId"] = state?.subnetId;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["tenantSettings"] = state?.tenantSettings;
            resourceInputs["zones"] = state?.zones;
        }
        else {
            const args = argsOrState;
            if (args?.capacity === undefined && !opts.urn) {
                throw new Error("Missing required property 'capacity'");
            }
            if (args?.family === undefined && !opts.urn) {
                throw new Error("Missing required property 'family'");
            }
            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["accessKeysAuthenticationEnabled"] = args?.accessKeysAuthenticationEnabled;
            resourceInputs["capacity"] = args?.capacity;
            resourceInputs["family"] = args?.family;
            resourceInputs["identity"] = args?.identity;
            resourceInputs["location"] = args?.location;
            resourceInputs["minimumTlsVersion"] = args?.minimumTlsVersion;
            resourceInputs["name"] = args?.name;
            resourceInputs["nonSslPortEnabled"] = args?.nonSslPortEnabled;
            resourceInputs["patchSchedules"] = args?.patchSchedules;
            resourceInputs["privateStaticIpAddress"] = args?.privateStaticIpAddress;
            resourceInputs["publicNetworkAccessEnabled"] = args?.publicNetworkAccessEnabled;
            resourceInputs["redisConfiguration"] = args?.redisConfiguration;
            resourceInputs["redisVersion"] = args?.redisVersion;
            resourceInputs["replicasPerMaster"] = args?.replicasPerMaster;
            resourceInputs["replicasPerPrimary"] = args?.replicasPerPrimary;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["shardCount"] = args?.shardCount;
            resourceInputs["skuName"] = args?.skuName;
            resourceInputs["subnetId"] = args?.subnetId;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["tenantSettings"] = args?.tenantSettings;
            resourceInputs["zones"] = args?.zones;
            resourceInputs["hostname"] = undefined /*out*/;
            resourceInputs["port"] = undefined /*out*/;
            resourceInputs["primaryAccessKey"] = undefined /*out*/;
            resourceInputs["primaryConnectionString"] = undefined /*out*/;
            resourceInputs["secondaryAccessKey"] = undefined /*out*/;
            resourceInputs["secondaryConnectionString"] = undefined /*out*/;
            resourceInputs["sslPort"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["primaryAccessKey", "primaryConnectionString", "secondaryAccessKey", "secondaryConnectionString"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(Cache.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Cache = Cache;
//# sourceMappingURL=cache.js.map