import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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 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 * ``` */ export declare 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: string, id: pulumi.Input, state?: CacheState, opts?: pulumi.CustomResourceOptions): 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: any): obj is Cache; /** * Whether access key authentication is enabled? Defaults to `true`. `activeDirectoryAuthenticationEnabled` must be set to `true` to disable access key authentication. */ readonly accessKeysAuthenticationEnabled: pulumi.Output; /** * The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4, 5`. */ readonly capacity: pulumi.Output; /** * The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`) */ readonly family: pulumi.Output; /** * The Hostname of the Redis Instance */ readonly hostname: pulumi.Output; /** * An `identity` block as defined below. */ readonly identity: pulumi.Output; /** * The location of the resource group. Changing this forces a new resource to be created. */ readonly location: pulumi.Output; /** * The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`. * * > **NOTE:** Azure Services will require TLS 1.2+ by August 2025, please see this [announcement](https://azure.microsoft.com/en-us/updates/v2/update-retirement-tls1-0-tls1-1-versions-azure-services/) for more. */ readonly minimumTlsVersion: pulumi.Output; /** * The name of the Redis instance. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * Enable the non-SSL port (6379) - disabled by default. */ readonly nonSslPortEnabled: pulumi.Output; /** * A list of `patchSchedule` blocks as defined below. */ readonly patchSchedules: pulumi.Output; /** * The non-SSL Port of the Redis Instance */ readonly port: pulumi.Output; /** * The Primary Access Key for the Redis Instance */ readonly primaryAccessKey: pulumi.Output; /** * The primary connection string of the Redis Instance. */ readonly primaryConnectionString: pulumi.Output; /** * The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnetId`. Changing this forces a new resource to be created. */ readonly privateStaticIpAddress: pulumi.Output; /** * Whether or not public network access is allowed for this Redis Cache. `true` means this resource could be accessed by both public and private endpoint. `false` means only private endpoint access is allowed. Defaults to `true`. */ readonly publicNetworkAccessEnabled: pulumi.Output; /** * A `redisConfiguration` block as defined below - with some limitations by SKU - defaults/details are shown below. */ readonly redisConfiguration: pulumi.Output; /** * Redis version. Only major version needed. Possible values are `4` and `6`. Defaults to `6`. */ readonly redisVersion: pulumi.Output; /** * Amount of replicas to create per master for this Redis Cache. * * > **Note:** Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards. */ readonly replicasPerMaster: pulumi.Output; /** * Amount of replicas to create per primary for this Redis Cache. If both `replicasPerPrimary` and `replicasPerMaster` are set, they need to be equal. */ readonly replicasPerPrimary: pulumi.Output; /** * The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created. */ readonly resourceGroupName: pulumi.Output; /** * The Secondary Access Key for the Redis Instance */ readonly secondaryAccessKey: pulumi.Output; /** * The secondary connection string of the Redis Instance. */ readonly secondaryConnectionString: pulumi.Output; /** * *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster. */ readonly shardCount: pulumi.Output; /** * The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`. * * > **Note** Downgrading the SKU will force a new resource to be created. */ readonly skuName: pulumi.Output; /** * The SSL Port of the Redis Instance */ readonly sslPort: pulumi.Output; /** * *Only available when using the Premium SKU* The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created. */ readonly subnetId: pulumi.Output; /** * A mapping of tags to assign to the resource. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * A mapping of tenant settings to assign to the resource. */ readonly tenantSettings: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created. * * > **Please Note:** Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll). */ readonly zones: pulumi.Output; /** * Create a Cache resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: CacheArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Cache resources. */ export interface CacheState { /** * Whether access key authentication is enabled? Defaults to `true`. `activeDirectoryAuthenticationEnabled` must be set to `true` to disable access key authentication. */ accessKeysAuthenticationEnabled?: pulumi.Input; /** * The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4, 5`. */ capacity?: pulumi.Input; /** * The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`) */ family?: pulumi.Input; /** * The Hostname of the Redis Instance */ hostname?: pulumi.Input; /** * An `identity` block as defined below. */ identity?: pulumi.Input; /** * The location of the resource group. Changing this forces a new resource to be created. */ location?: pulumi.Input; /** * The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`. * * > **NOTE:** Azure Services will require TLS 1.2+ by August 2025, please see this [announcement](https://azure.microsoft.com/en-us/updates/v2/update-retirement-tls1-0-tls1-1-versions-azure-services/) for more. */ minimumTlsVersion?: pulumi.Input; /** * The name of the Redis instance. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * Enable the non-SSL port (6379) - disabled by default. */ nonSslPortEnabled?: pulumi.Input; /** * A list of `patchSchedule` blocks as defined below. */ patchSchedules?: pulumi.Input[]>; /** * The non-SSL Port of the Redis Instance */ port?: pulumi.Input; /** * The Primary Access Key for the Redis Instance */ primaryAccessKey?: pulumi.Input; /** * The primary connection string of the Redis Instance. */ primaryConnectionString?: pulumi.Input; /** * The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnetId`. Changing this forces a new resource to be created. */ privateStaticIpAddress?: pulumi.Input; /** * Whether or not public network access is allowed for this Redis Cache. `true` means this resource could be accessed by both public and private endpoint. `false` means only private endpoint access is allowed. Defaults to `true`. */ publicNetworkAccessEnabled?: pulumi.Input; /** * A `redisConfiguration` block as defined below - with some limitations by SKU - defaults/details are shown below. */ redisConfiguration?: pulumi.Input; /** * Redis version. Only major version needed. Possible values are `4` and `6`. Defaults to `6`. */ redisVersion?: pulumi.Input; /** * Amount of replicas to create per master for this Redis Cache. * * > **Note:** Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards. */ replicasPerMaster?: pulumi.Input; /** * Amount of replicas to create per primary for this Redis Cache. If both `replicasPerPrimary` and `replicasPerMaster` are set, they need to be equal. */ replicasPerPrimary?: pulumi.Input; /** * The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created. */ resourceGroupName?: pulumi.Input; /** * The Secondary Access Key for the Redis Instance */ secondaryAccessKey?: pulumi.Input; /** * The secondary connection string of the Redis Instance. */ secondaryConnectionString?: pulumi.Input; /** * *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster. */ shardCount?: pulumi.Input; /** * The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`. * * > **Note** Downgrading the SKU will force a new resource to be created. */ skuName?: pulumi.Input; /** * The SSL Port of the Redis Instance */ sslPort?: pulumi.Input; /** * *Only available when using the Premium SKU* The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created. */ subnetId?: pulumi.Input; /** * A mapping of tags to assign to the resource. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * A mapping of tenant settings to assign to the resource. */ tenantSettings?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created. * * > **Please Note:** Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll). */ zones?: pulumi.Input[]>; } /** * The set of arguments for constructing a Cache resource. */ export interface CacheArgs { /** * Whether access key authentication is enabled? Defaults to `true`. `activeDirectoryAuthenticationEnabled` must be set to `true` to disable access key authentication. */ accessKeysAuthenticationEnabled?: pulumi.Input; /** * The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4, 5`. */ capacity: pulumi.Input; /** * The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for `Premium`) */ family: pulumi.Input; /** * An `identity` block as defined below. */ identity?: pulumi.Input; /** * The location of the resource group. Changing this forces a new resource to be created. */ location?: pulumi.Input; /** * The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`. * * > **NOTE:** Azure Services will require TLS 1.2+ by August 2025, please see this [announcement](https://azure.microsoft.com/en-us/updates/v2/update-retirement-tls1-0-tls1-1-versions-azure-services/) for more. */ minimumTlsVersion?: pulumi.Input; /** * The name of the Redis instance. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * Enable the non-SSL port (6379) - disabled by default. */ nonSslPortEnabled?: pulumi.Input; /** * A list of `patchSchedule` blocks as defined below. */ patchSchedules?: pulumi.Input[]>; /** * The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnetId`. Changing this forces a new resource to be created. */ privateStaticIpAddress?: pulumi.Input; /** * Whether or not public network access is allowed for this Redis Cache. `true` means this resource could be accessed by both public and private endpoint. `false` means only private endpoint access is allowed. Defaults to `true`. */ publicNetworkAccessEnabled?: pulumi.Input; /** * A `redisConfiguration` block as defined below - with some limitations by SKU - defaults/details are shown below. */ redisConfiguration?: pulumi.Input; /** * Redis version. Only major version needed. Possible values are `4` and `6`. Defaults to `6`. */ redisVersion?: pulumi.Input; /** * Amount of replicas to create per master for this Redis Cache. * * > **Note:** Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards. */ replicasPerMaster?: pulumi.Input; /** * Amount of replicas to create per primary for this Redis Cache. If both `replicasPerPrimary` and `replicasPerMaster` are set, they need to be equal. */ replicasPerPrimary?: pulumi.Input; /** * The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created. */ resourceGroupName: pulumi.Input; /** * *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster. */ shardCount?: pulumi.Input; /** * The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`. * * > **Note** Downgrading the SKU will force a new resource to be created. */ skuName: pulumi.Input; /** * *Only available when using the Premium SKU* The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created. */ subnetId?: pulumi.Input; /** * A mapping of tags to assign to the resource. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * A mapping of tenant settings to assign to the resource. */ tenantSettings?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created. * * > **Please Note:** Availability Zones are [in Preview and only supported in several regions at this time](https://docs.microsoft.com/azure/availability-zones/az-overview) - as such you must be opted into the Preview to use this functionality. You can [opt into the Availability Zones Preview in the Azure Portal](https://aka.ms/azenroll). */ zones?: pulumi.Input[]>; }