Skip to content

Data Source: azurermRedisCache

Use this data source to access information about an existing Redis Cache

Example Usage

import * as cdktf from "cdktf";
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const dataAzurermRedisCacheExample =
  new azurerm.dataAzurermRedisCache.DataAzurermRedisCache(this, "example", {
    name: "myrediscache",
    resource_group_name: "redis-cache",
  });
new cdktf.TerraformOutput(this, "hostname", {
  value: dataAzurermRedisCacheExample.hostname,
});
new cdktf.TerraformOutput(this, "primary_access_key", {
  value: dataAzurermRedisCacheExample.primaryAccessKey,
});

Argument Reference

  • name - The name of the Redis cache

  • resourceGroupName - The name of the resource group the Redis cache instance is located in.

Attributes Reference

  • id - The Cache ID.

  • location - The location of the Redis Cache.

  • capacity - The size of the Redis Cache deployed.

  • family - The SKU family/pricing group used. Possible values are c (for Basic/Standard SKU family) and p (for premium)

  • skuName - The SKU of Redis used. Possible values are basic, standard and premium.

  • enableNonSslPort - Whether the SSL port is enabled.

  • minimumTlsVersion - The minimum TLS version.

  • patchSchedule - A list of patchSchedule blocks as defined below.

  • privateStaticIpAddress The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.

  • hostname - The Hostname of the Redis Instance

  • sslPort - The SSL Port of the Redis Instance

  • port - The non-SSL Port of the Redis Instance

  • primaryAccessKey - The Primary Access Key for the Redis Instance

  • secondaryAccessKey - The Secondary Access Key for the Redis Instance

  • primaryConnectionString - The primary connection string of the Redis Instance.

  • secondaryConnectionString - The secondary connection string of the Redis Instance.

  • redisConfiguration - A redisConfiguration block as defined below.

  • zones - A list of Availability Zones in which this Redis Cache is located.


A patchSchedule block supports the following:

  • dayOfWeek - the Weekday name for the patch item

  • maintenanceWindow - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.

  • startHourUtc - The Start Hour for maintenance in UTC

\~> Note: The Patch Window lasts for 5 hours from the startHourUtc.


A redisConfiguration block exports the following:

  • enableAuthentication - Specifies if authentication is enabled

  • maxmemoryReserved - The value in megabytes reserved for non-cache usage e.g. failover

  • maxmemoryDelta - The max-memory delta for this Redis instance.

  • maxmemoryPolicy - How Redis will select what to remove when maxmemory is reached.

  • maxfragmentationmemoryReserved - Value in megabytes reserved to accommodate for memory fragmentation.

  • rdbBackupEnabled - Is Backup Enabled? Only supported on Premium SKUs.

  • rdbBackupFrequency - The Backup Frequency in Minutes. Only supported on Premium SKUs.

  • rdbBackupMaxSnapshotCount - The maximum number of snapshots that can be created as a backup.

  • rdbStorageConnectionString - The Connection String to the Storage Account. Only supported for Premium SKUs.

\~> Note: There's a bug in the Redis API where the original storage connection string isn't being returned, which is being tracked in this issue. In the interim you can use the ignoreChanges attribute to ignore changes to this field e.g.:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • read - (Defaults to 5 minutes) Used when retrieving the Redis Cache.