We recommend using Azure Native.
Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi
azure.redis.getCache
Explore with Pulumi AI
Use this data source to access information about an existing Redis Cache
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.redis.getCache({
name: "myrediscache",
resourceGroupName: "redis-cache",
});
export const primaryAccessKey = example.then(example => example.primaryAccessKey);
export const hostname = example.then(example => example.hostname);
import pulumi
import pulumi_azure as azure
example = azure.redis.get_cache(name="myrediscache",
resource_group_name="redis-cache")
pulumi.export("primaryAccessKey", example.primary_access_key)
pulumi.export("hostname", example.hostname)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/redis"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := redis.LookupCache(ctx, &redis.LookupCacheArgs{
Name: "myrediscache",
ResourceGroupName: "redis-cache",
}, nil)
if err != nil {
return err
}
ctx.Export("primaryAccessKey", example.PrimaryAccessKey)
ctx.Export("hostname", example.Hostname)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Redis.GetCache.Invoke(new()
{
Name = "myrediscache",
ResourceGroupName = "redis-cache",
});
return new Dictionary<string, object?>
{
["primaryAccessKey"] = example.Apply(getCacheResult => getCacheResult.PrimaryAccessKey),
["hostname"] = example.Apply(getCacheResult => getCacheResult.Hostname),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.redis.RedisFunctions;
import com.pulumi.azure.redis.inputs.GetCacheArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = RedisFunctions.getCache(GetCacheArgs.builder()
.name("myrediscache")
.resourceGroupName("redis-cache")
.build());
ctx.export("primaryAccessKey", example.applyValue(getCacheResult -> getCacheResult.primaryAccessKey()));
ctx.export("hostname", example.applyValue(getCacheResult -> getCacheResult.hostname()));
}
}
variables:
example:
fn::invoke:
function: azure:redis:getCache
arguments:
name: myrediscache
resourceGroupName: redis-cache
outputs:
primaryAccessKey: ${example.primaryAccessKey}
hostname: ${example.hostname}
Using getCache
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCache(args: GetCacheArgs, opts?: InvokeOptions): Promise<GetCacheResult>
function getCacheOutput(args: GetCacheOutputArgs, opts?: InvokeOptions): Output<GetCacheResult>
def get_cache(name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetCacheResult
def get_cache_output(name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetCacheResult]
func LookupCache(ctx *Context, args *LookupCacheArgs, opts ...InvokeOption) (*LookupCacheResult, error)
func LookupCacheOutput(ctx *Context, args *LookupCacheOutputArgs, opts ...InvokeOption) LookupCacheResultOutput
> Note: This function is named LookupCache
in the Go SDK.
public static class GetCache
{
public static Task<GetCacheResult> InvokeAsync(GetCacheArgs args, InvokeOptions? opts = null)
public static Output<GetCacheResult> Invoke(GetCacheInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetCacheResult> getCache(GetCacheArgs args, InvokeOptions options)
public static Output<GetCacheResult> getCache(GetCacheArgs args, InvokeOptions options)
fn::invoke:
function: azure:redis/getCache:getCache
arguments:
# arguments dictionary
The following arguments are supported:
- Name
This property is required. string - The name of the Redis cache
- Resource
Group Name This property is required. string - The name of the resource group the Redis cache instance is located in.
- Name
This property is required. string - The name of the Redis cache
- Resource
Group Name This property is required. string - The name of the resource group the Redis cache instance is located in.
- name
This property is required. String - The name of the Redis cache
- resource
Group Name This property is required. String - The name of the resource group the Redis cache instance is located in.
- name
This property is required. string - The name of the Redis cache
- resource
Group Name This property is required. string - The name of the resource group the Redis cache instance is located in.
- name
This property is required. str - The name of the Redis cache
- resource_
group_ name This property is required. str - The name of the resource group the Redis cache instance is located in.
- name
This property is required. String - The name of the Redis cache
- resource
Group Name This property is required. String - The name of the resource group the Redis cache instance is located in.
getCache Result
The following output properties are available:
- Access
Keys boolAuthentication Enabled - Specifies if access key authentication is enabled.
- Capacity int
- The size of the Redis Cache deployed.
- Family string
- The SKU family/pricing group used. Possible values are
C
(for Basic/Standard SKU family) andP
(forPremium
) - Hostname string
- The Hostname of the Redis Instance
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The location of the Redis Cache.
- Minimum
Tls stringVersion - The minimum TLS version.
- Name string
- Non
Ssl boolPort Enabled - Patch
Schedules List<GetCache Patch Schedule> - A list of
patch_schedule
blocks as defined below. - Port int
- The non-SSL Port of the Redis Instance
- Primary
Access stringKey - The Primary Access Key for the Redis Instance
- Primary
Connection stringString - The primary connection string of the Redis Instance.
- Private
Static stringIp Address - The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.
- Redis
Configurations List<GetCache Redis Configuration> - A
redis_configuration
block as defined below. - Resource
Group stringName - Secondary
Access stringKey - The Secondary Access Key for the Redis Instance
- Secondary
Connection stringString - The secondary connection string of the Redis Instance.
- int
- Sku
Name string - The SKU of Redis used. Possible values are
Basic
,Standard
andPremium
. - Ssl
Port int - The SSL Port of the Redis Instance
- Subnet
Id string - Dictionary<string, string>
- Zones List<string>
- A list of Availability Zones in which this Redis Cache is located.
- Access
Keys boolAuthentication Enabled - Specifies if access key authentication is enabled.
- Capacity int
- The size of the Redis Cache deployed.
- Family string
- The SKU family/pricing group used. Possible values are
C
(for Basic/Standard SKU family) andP
(forPremium
) - Hostname string
- The Hostname of the Redis Instance
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The location of the Redis Cache.
- Minimum
Tls stringVersion - The minimum TLS version.
- Name string
- Non
Ssl boolPort Enabled - Patch
Schedules []GetCache Patch Schedule - A list of
patch_schedule
blocks as defined below. - Port int
- The non-SSL Port of the Redis Instance
- Primary
Access stringKey - The Primary Access Key for the Redis Instance
- Primary
Connection stringString - The primary connection string of the Redis Instance.
- Private
Static stringIp Address - The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.
- Redis
Configurations []GetCache Redis Configuration - A
redis_configuration
block as defined below. - Resource
Group stringName - Secondary
Access stringKey - The Secondary Access Key for the Redis Instance
- Secondary
Connection stringString - The secondary connection string of the Redis Instance.
- int
- Sku
Name string - The SKU of Redis used. Possible values are
Basic
,Standard
andPremium
. - Ssl
Port int - The SSL Port of the Redis Instance
- Subnet
Id string - map[string]string
- Zones []string
- A list of Availability Zones in which this Redis Cache is located.
- access
Keys BooleanAuthentication Enabled - Specifies if access key authentication is enabled.
- capacity Integer
- The size of the Redis Cache deployed.
- family String
- The SKU family/pricing group used. Possible values are
C
(for Basic/Standard SKU family) andP
(forPremium
) - hostname String
- The Hostname of the Redis Instance
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The location of the Redis Cache.
- minimum
Tls StringVersion - The minimum TLS version.
- name String
- non
Ssl BooleanPort Enabled - patch
Schedules List<GetCache Patch Schedule> - A list of
patch_schedule
blocks as defined below. - port Integer
- The non-SSL Port of the Redis Instance
- primary
Access StringKey - The Primary Access Key for the Redis Instance
- primary
Connection StringString - The primary connection string of the Redis Instance.
- private
Static StringIp Address - The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.
- redis
Configurations List<GetCache Redis Configuration> - A
redis_configuration
block as defined below. - resource
Group StringName - secondary
Access StringKey - The Secondary Access Key for the Redis Instance
- secondary
Connection StringString - The secondary connection string of the Redis Instance.
- Integer
- sku
Name String - The SKU of Redis used. Possible values are
Basic
,Standard
andPremium
. - ssl
Port Integer - The SSL Port of the Redis Instance
- subnet
Id String - Map<String,String>
- zones List<String>
- A list of Availability Zones in which this Redis Cache is located.
- access
Keys booleanAuthentication Enabled - Specifies if access key authentication is enabled.
- capacity number
- The size of the Redis Cache deployed.
- family string
- The SKU family/pricing group used. Possible values are
C
(for Basic/Standard SKU family) andP
(forPremium
) - hostname string
- The Hostname of the Redis Instance
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- The location of the Redis Cache.
- minimum
Tls stringVersion - The minimum TLS version.
- name string
- non
Ssl booleanPort Enabled - patch
Schedules GetCache Patch Schedule[] - A list of
patch_schedule
blocks as defined below. - port number
- The non-SSL Port of the Redis Instance
- primary
Access stringKey - The Primary Access Key for the Redis Instance
- primary
Connection stringString - The primary connection string of the Redis Instance.
- private
Static stringIp Address - The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.
- redis
Configurations GetCache Redis Configuration[] - A
redis_configuration
block as defined below. - resource
Group stringName - secondary
Access stringKey - The Secondary Access Key for the Redis Instance
- secondary
Connection stringString - The secondary connection string of the Redis Instance.
- number
- sku
Name string - The SKU of Redis used. Possible values are
Basic
,Standard
andPremium
. - ssl
Port number - The SSL Port of the Redis Instance
- subnet
Id string - {[key: string]: string}
- zones string[]
- A list of Availability Zones in which this Redis Cache is located.
- access_
keys_ boolauthentication_ enabled - Specifies if access key authentication is enabled.
- capacity int
- The size of the Redis Cache deployed.
- family str
- The SKU family/pricing group used. Possible values are
C
(for Basic/Standard SKU family) andP
(forPremium
) - hostname str
- The Hostname of the Redis Instance
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- The location of the Redis Cache.
- minimum_
tls_ strversion - The minimum TLS version.
- name str
- non_
ssl_ boolport_ enabled - patch_
schedules Sequence[GetCache Patch Schedule] - A list of
patch_schedule
blocks as defined below. - port int
- The non-SSL Port of the Redis Instance
- primary_
access_ strkey - The Primary Access Key for the Redis Instance
- primary_
connection_ strstring - The primary connection string of the Redis Instance.
- private_
static_ strip_ address - The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.
- redis_
configurations Sequence[GetCache Redis Configuration] - A
redis_configuration
block as defined below. - resource_
group_ strname - secondary_
access_ strkey - The Secondary Access Key for the Redis Instance
- secondary_
connection_ strstring - The secondary connection string of the Redis Instance.
- int
- sku_
name str - The SKU of Redis used. Possible values are
Basic
,Standard
andPremium
. - ssl_
port int - The SSL Port of the Redis Instance
- subnet_
id str - Mapping[str, str]
- zones Sequence[str]
- A list of Availability Zones in which this Redis Cache is located.
- access
Keys BooleanAuthentication Enabled - Specifies if access key authentication is enabled.
- capacity Number
- The size of the Redis Cache deployed.
- family String
- The SKU family/pricing group used. Possible values are
C
(for Basic/Standard SKU family) andP
(forPremium
) - hostname String
- The Hostname of the Redis Instance
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The location of the Redis Cache.
- minimum
Tls StringVersion - The minimum TLS version.
- name String
- non
Ssl BooleanPort Enabled - patch
Schedules List<Property Map> - A list of
patch_schedule
blocks as defined below. - port Number
- The non-SSL Port of the Redis Instance
- primary
Access StringKey - The Primary Access Key for the Redis Instance
- primary
Connection StringString - The primary connection string of the Redis Instance.
- private
Static StringIp Address - The Static IP Address assigned to the Redis Cache when hosted inside the Virtual Network.
- redis
Configurations List<Property Map> - A
redis_configuration
block as defined below. - resource
Group StringName - secondary
Access StringKey - The Secondary Access Key for the Redis Instance
- secondary
Connection StringString - The secondary connection string of the Redis Instance.
- Number
- sku
Name String - The SKU of Redis used. Possible values are
Basic
,Standard
andPremium
. - ssl
Port Number - The SSL Port of the Redis Instance
- subnet
Id String - Map<String>
- zones List<String>
- A list of Availability Zones in which this Redis Cache is located.
Supporting Types
GetCachePatchSchedule
- Day
Of Week This property is required. string - the Weekday name for the patch item
- Maintenance
Window This property is required. string - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- Start
Hour Utc This property is required. int - The Start Hour for maintenance in UTC
- Day
Of Week This property is required. string - the Weekday name for the patch item
- Maintenance
Window This property is required. string - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- Start
Hour Utc This property is required. int - The Start Hour for maintenance in UTC
- day
Of Week This property is required. String - the Weekday name for the patch item
- maintenance
Window This property is required. String - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- start
Hour Utc This property is required. Integer - The Start Hour for maintenance in UTC
- day
Of Week This property is required. string - the Weekday name for the patch item
- maintenance
Window This property is required. string - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- start
Hour Utc This property is required. number - The Start Hour for maintenance in UTC
- day_
of_ week This property is required. str - the Weekday name for the patch item
- maintenance_
window This property is required. str - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- start_
hour_ utc This property is required. int - The Start Hour for maintenance in UTC
- day
Of Week This property is required. String - the Weekday name for the patch item
- maintenance
Window This property is required. String - The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- start
Hour Utc This property is required. Number - The Start Hour for maintenance in UTC
GetCacheRedisConfiguration
- Active
Directory Authentication Enabled This property is required. bool - Specifies if Microsoft Entra (AAD) authentication is enabled.
- Aof
Backup Enabled This property is required. bool - Aof
Storage Connection String0 This property is required. string - Aof
Storage Connection String1 This property is required. string - Authentication
Enabled This property is required. bool - Data
Persistence Authentication Method This property is required. string - Maxclients
This property is required. int - Maxfragmentationmemory
Reserved This property is required. int - Value in megabytes reserved to accommodate for memory fragmentation.
- Maxmemory
Delta This property is required. int - The max-memory delta for this Redis instance.
- Maxmemory
Policy This property is required. string - How Redis will select what to remove when
maxmemory
is reached. - Maxmemory
Reserved This property is required. int - The value in megabytes reserved for non-cache usage e.g. failover
- Notify
Keyspace Events This property is required. string - Rdb
Backup Enabled This property is required. bool - Is Backup Enabled? Only supported on Premium SKUs.
- Rdb
Backup Frequency This property is required. int - The Backup Frequency in Minutes. Only supported on Premium SKUs.
- Rdb
Backup Max Snapshot Count This property is required. int - The maximum number of snapshots that can be created as a backup.
- Rdb
Storage Connection String This property is required. string - The Connection String to the Storage Account. Only supported for Premium SKUs.
- Storage
Account Subscription Id This property is required. string - The ID of the Subscription containing the Storage Account.
- Active
Directory Authentication Enabled This property is required. bool - Specifies if Microsoft Entra (AAD) authentication is enabled.
- Aof
Backup Enabled This property is required. bool - Aof
Storage Connection String0 This property is required. string - Aof
Storage Connection String1 This property is required. string - Authentication
Enabled This property is required. bool - Data
Persistence Authentication Method This property is required. string - Maxclients
This property is required. int - Maxfragmentationmemory
Reserved This property is required. int - Value in megabytes reserved to accommodate for memory fragmentation.
- Maxmemory
Delta This property is required. int - The max-memory delta for this Redis instance.
- Maxmemory
Policy This property is required. string - How Redis will select what to remove when
maxmemory
is reached. - Maxmemory
Reserved This property is required. int - The value in megabytes reserved for non-cache usage e.g. failover
- Notify
Keyspace Events This property is required. string - Rdb
Backup Enabled This property is required. bool - Is Backup Enabled? Only supported on Premium SKUs.
- Rdb
Backup Frequency This property is required. int - The Backup Frequency in Minutes. Only supported on Premium SKUs.
- Rdb
Backup Max Snapshot Count This property is required. int - The maximum number of snapshots that can be created as a backup.
- Rdb
Storage Connection String This property is required. string - The Connection String to the Storage Account. Only supported for Premium SKUs.
- Storage
Account Subscription Id This property is required. string - The ID of the Subscription containing the Storage Account.
- active
Directory Authentication Enabled This property is required. Boolean - Specifies if Microsoft Entra (AAD) authentication is enabled.
- aof
Backup Enabled This property is required. Boolean - aof
Storage Connection String0 This property is required. String - aof
Storage Connection String1 This property is required. String - authentication
Enabled This property is required. Boolean - data
Persistence Authentication Method This property is required. String - maxclients
This property is required. Integer - maxfragmentationmemory
Reserved This property is required. Integer - Value in megabytes reserved to accommodate for memory fragmentation.
- maxmemory
Delta This property is required. Integer - The max-memory delta for this Redis instance.
- maxmemory
Policy This property is required. String - How Redis will select what to remove when
maxmemory
is reached. - maxmemory
Reserved This property is required. Integer - The value in megabytes reserved for non-cache usage e.g. failover
- notify
Keyspace Events This property is required. String - rdb
Backup Enabled This property is required. Boolean - Is Backup Enabled? Only supported on Premium SKUs.
- rdb
Backup Frequency This property is required. Integer - The Backup Frequency in Minutes. Only supported on Premium SKUs.
- rdb
Backup Max Snapshot Count This property is required. Integer - The maximum number of snapshots that can be created as a backup.
- rdb
Storage Connection String This property is required. String - The Connection String to the Storage Account. Only supported for Premium SKUs.
- storage
Account Subscription Id This property is required. String - The ID of the Subscription containing the Storage Account.
- active
Directory Authentication Enabled This property is required. boolean - Specifies if Microsoft Entra (AAD) authentication is enabled.
- aof
Backup Enabled This property is required. boolean - aof
Storage Connection String0 This property is required. string - aof
Storage Connection String1 This property is required. string - authentication
Enabled This property is required. boolean - data
Persistence Authentication Method This property is required. string - maxclients
This property is required. number - maxfragmentationmemory
Reserved This property is required. number - Value in megabytes reserved to accommodate for memory fragmentation.
- maxmemory
Delta This property is required. number - The max-memory delta for this Redis instance.
- maxmemory
Policy This property is required. string - How Redis will select what to remove when
maxmemory
is reached. - maxmemory
Reserved This property is required. number - The value in megabytes reserved for non-cache usage e.g. failover
- notify
Keyspace Events This property is required. string - rdb
Backup Enabled This property is required. boolean - Is Backup Enabled? Only supported on Premium SKUs.
- rdb
Backup Frequency This property is required. number - The Backup Frequency in Minutes. Only supported on Premium SKUs.
- rdb
Backup Max Snapshot Count This property is required. number - The maximum number of snapshots that can be created as a backup.
- rdb
Storage Connection String This property is required. string - The Connection String to the Storage Account. Only supported for Premium SKUs.
- storage
Account Subscription Id This property is required. string - The ID of the Subscription containing the Storage Account.
- active_
directory_ authentication_ enabled This property is required. bool - Specifies if Microsoft Entra (AAD) authentication is enabled.
- aof_
backup_ enabled This property is required. bool - aof_
storage_ connection_ string0 This property is required. str - aof_
storage_ connection_ string1 This property is required. str - authentication_
enabled This property is required. bool - data_
persistence_ authentication_ method This property is required. str - maxclients
This property is required. int - maxfragmentationmemory_
reserved This property is required. int - Value in megabytes reserved to accommodate for memory fragmentation.
- maxmemory_
delta This property is required. int - The max-memory delta for this Redis instance.
- maxmemory_
policy This property is required. str - How Redis will select what to remove when
maxmemory
is reached. - maxmemory_
reserved This property is required. int - The value in megabytes reserved for non-cache usage e.g. failover
- notify_
keyspace_ events This property is required. str - rdb_
backup_ enabled This property is required. bool - Is Backup Enabled? Only supported on Premium SKUs.
- rdb_
backup_ frequency This property is required. int - The Backup Frequency in Minutes. Only supported on Premium SKUs.
- rdb_
backup_ max_ snapshot_ count This property is required. int - The maximum number of snapshots that can be created as a backup.
- rdb_
storage_ connection_ string This property is required. str - The Connection String to the Storage Account. Only supported for Premium SKUs.
- storage_
account_ subscription_ id This property is required. str - The ID of the Subscription containing the Storage Account.
- active
Directory Authentication Enabled This property is required. Boolean - Specifies if Microsoft Entra (AAD) authentication is enabled.
- aof
Backup Enabled This property is required. Boolean - aof
Storage Connection String0 This property is required. String - aof
Storage Connection String1 This property is required. String - authentication
Enabled This property is required. Boolean - data
Persistence Authentication Method This property is required. String - maxclients
This property is required. Number - maxfragmentationmemory
Reserved This property is required. Number - Value in megabytes reserved to accommodate for memory fragmentation.
- maxmemory
Delta This property is required. Number - The max-memory delta for this Redis instance.
- maxmemory
Policy This property is required. String - How Redis will select what to remove when
maxmemory
is reached. - maxmemory
Reserved This property is required. Number - The value in megabytes reserved for non-cache usage e.g. failover
- notify
Keyspace Events This property is required. String - rdb
Backup Enabled This property is required. Boolean - Is Backup Enabled? Only supported on Premium SKUs.
- rdb
Backup Frequency This property is required. Number - The Backup Frequency in Minutes. Only supported on Premium SKUs.
- rdb
Backup Max Snapshot Count This property is required. Number - The maximum number of snapshots that can be created as a backup.
- rdb
Storage Connection String This property is required. String - The Connection String to the Storage Account. Only supported for Premium SKUs.
- storage
Account Subscription Id This property is required. String - The ID of the Subscription containing the Storage Account.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.