We recommend using Azure Native.
azure.redis.getCache
Explore with Pulumi AI
Use this data source to access information about an existing Redis Cache
Example Usage
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 main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/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
})
}
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()));
}
}
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)
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);
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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: azure:redis/getCache:getCache
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
The name of the Redis cache
- Resource
Group stringName The name of the resource group the Redis cache instance is located in.
- Name string
The name of the Redis cache
- Resource
Group stringName The name of the resource group the Redis cache instance is located in.
- name String
The name of the Redis cache
- resource
Group StringName The name of the resource group the Redis cache instance is located in.
- name string
The name of the Redis cache
- resource
Group stringName The name of the resource group the Redis cache instance is located in.
- name str
The name of the Redis cache
- resource_
group_ strname The name of the resource group the Redis cache instance is located in.
- name String
The name of the Redis cache
- resource
Group StringName The name of the resource group the Redis cache instance is located in.
getCache Result
The following output properties are available:
- Capacity int
The size of the Redis Cache deployed.
- Enable
Non boolSsl Port Whether the SSL port is enabled.
- 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
- 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.
- Capacity int
The size of the Redis Cache deployed.
- Enable
Non boolSsl Port Whether the SSL port is enabled.
- 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
- 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.
- capacity Integer
The size of the Redis Cache deployed.
- enable
Non BooleanSsl Port Whether the SSL port is enabled.
- 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
- 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.
- capacity number
The size of the Redis Cache deployed.
- enable
Non booleanSsl Port Whether the SSL port is enabled.
- 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
- 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.
- capacity int
The size of the Redis Cache deployed.
- enable_
non_ boolssl_ port Whether the SSL port is enabled.
- 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
- 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.
- capacity Number
The size of the Redis Cache deployed.
- enable
Non BooleanSsl Port Whether the SSL port is enabled.
- 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
- 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 stringWeek the Weekday name for the patch item
- Maintenance
Window string The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- Start
Hour intUtc The Start Hour for maintenance in UTC
- Day
Of stringWeek the Weekday name for the patch item
- Maintenance
Window string The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- Start
Hour intUtc The Start Hour for maintenance in UTC
- day
Of StringWeek the Weekday name for the patch item
- maintenance
Window String The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- start
Hour IntegerUtc The Start Hour for maintenance in UTC
- day
Of stringWeek the Weekday name for the patch item
- maintenance
Window string The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- start
Hour numberUtc The Start Hour for maintenance in UTC
- day_
of_ strweek the Weekday name for the patch item
- maintenance_
window str The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- start_
hour_ intutc The Start Hour for maintenance in UTC
- day
Of StringWeek the Weekday name for the patch item
- maintenance
Window String The ISO 8601 timespan which specifies the amount of time the Redis Cache can be updated.
- start
Hour NumberUtc The Start Hour for maintenance in UTC
GetCacheRedisConfiguration
- Aof
Backup boolEnabled - Aof
Storage stringConnection String0 - Aof
Storage stringConnection String1 - Enable
Authentication bool Specifies if authentication is enabled
- Maxclients int
- Maxfragmentationmemory
Reserved int Value in megabytes reserved to accommodate for memory fragmentation.
- Maxmemory
Delta int The max-memory delta for this Redis instance.
- Maxmemory
Policy string How Redis will select what to remove when
maxmemory
is reached.- Maxmemory
Reserved int The value in megabytes reserved for non-cache usage e.g. failover
- Notify
Keyspace stringEvents - Rdb
Backup boolEnabled Is Backup Enabled? Only supported on Premium SKUs.
- Rdb
Backup intFrequency The Backup Frequency in Minutes. Only supported on Premium SKUs.
- Rdb
Backup intMax Snapshot Count The maximum number of snapshots that can be created as a backup.
- Rdb
Storage stringConnection String The Connection String to the Storage Account. Only supported for Premium SKUs.
- Aof
Backup boolEnabled - Aof
Storage stringConnection String0 - Aof
Storage stringConnection String1 - Enable
Authentication bool Specifies if authentication is enabled
- Maxclients int
- Maxfragmentationmemory
Reserved int Value in megabytes reserved to accommodate for memory fragmentation.
- Maxmemory
Delta int The max-memory delta for this Redis instance.
- Maxmemory
Policy string How Redis will select what to remove when
maxmemory
is reached.- Maxmemory
Reserved int The value in megabytes reserved for non-cache usage e.g. failover
- Notify
Keyspace stringEvents - Rdb
Backup boolEnabled Is Backup Enabled? Only supported on Premium SKUs.
- Rdb
Backup intFrequency The Backup Frequency in Minutes. Only supported on Premium SKUs.
- Rdb
Backup intMax Snapshot Count The maximum number of snapshots that can be created as a backup.
- Rdb
Storage stringConnection String The Connection String to the Storage Account. Only supported for Premium SKUs.
- aof
Backup BooleanEnabled - aof
Storage StringConnection String0 - aof
Storage StringConnection String1 - enable
Authentication Boolean Specifies if authentication is enabled
- maxclients Integer
- maxfragmentationmemory
Reserved Integer Value in megabytes reserved to accommodate for memory fragmentation.
- maxmemory
Delta Integer The max-memory delta for this Redis instance.
- maxmemory
Policy String How Redis will select what to remove when
maxmemory
is reached.- maxmemory
Reserved Integer The value in megabytes reserved for non-cache usage e.g. failover
- notify
Keyspace StringEvents - rdb
Backup BooleanEnabled Is Backup Enabled? Only supported on Premium SKUs.
- rdb
Backup IntegerFrequency The Backup Frequency in Minutes. Only supported on Premium SKUs.
- rdb
Backup IntegerMax Snapshot Count The maximum number of snapshots that can be created as a backup.
- rdb
Storage StringConnection String The Connection String to the Storage Account. Only supported for Premium SKUs.
- aof
Backup booleanEnabled - aof
Storage stringConnection String0 - aof
Storage stringConnection String1 - enable
Authentication boolean Specifies if authentication is enabled
- maxclients number
- maxfragmentationmemory
Reserved number Value in megabytes reserved to accommodate for memory fragmentation.
- maxmemory
Delta number The max-memory delta for this Redis instance.
- maxmemory
Policy string How Redis will select what to remove when
maxmemory
is reached.- maxmemory
Reserved number The value in megabytes reserved for non-cache usage e.g. failover
- notify
Keyspace stringEvents - rdb
Backup booleanEnabled Is Backup Enabled? Only supported on Premium SKUs.
- rdb
Backup numberFrequency The Backup Frequency in Minutes. Only supported on Premium SKUs.
- rdb
Backup numberMax Snapshot Count The maximum number of snapshots that can be created as a backup.
- rdb
Storage stringConnection String The Connection String to the Storage Account. Only supported for Premium SKUs.
- aof_
backup_ boolenabled - aof_
storage_ strconnection_ string0 - aof_
storage_ strconnection_ string1 - enable_
authentication bool Specifies if authentication is enabled
- maxclients int
- maxfragmentationmemory_
reserved int Value in megabytes reserved to accommodate for memory fragmentation.
- maxmemory_
delta int The max-memory delta for this Redis instance.
- maxmemory_
policy str How Redis will select what to remove when
maxmemory
is reached.- maxmemory_
reserved int The value in megabytes reserved for non-cache usage e.g. failover
- notify_
keyspace_ strevents - rdb_
backup_ boolenabled Is Backup Enabled? Only supported on Premium SKUs.
- rdb_
backup_ intfrequency The Backup Frequency in Minutes. Only supported on Premium SKUs.
- rdb_
backup_ intmax_ snapshot_ count The maximum number of snapshots that can be created as a backup.
- rdb_
storage_ strconnection_ string The Connection String to the Storage Account. Only supported for Premium SKUs.
- aof
Backup BooleanEnabled - aof
Storage StringConnection String0 - aof
Storage StringConnection String1 - enable
Authentication Boolean Specifies if authentication is enabled
- maxclients Number
- maxfragmentationmemory
Reserved Number Value in megabytes reserved to accommodate for memory fragmentation.
- maxmemory
Delta Number The max-memory delta for this Redis instance.
- maxmemory
Policy String How Redis will select what to remove when
maxmemory
is reached.- maxmemory
Reserved Number The value in megabytes reserved for non-cache usage e.g. failover
- notify
Keyspace StringEvents - rdb
Backup BooleanEnabled Is Backup Enabled? Only supported on Premium SKUs.
- rdb
Backup NumberFrequency The Backup Frequency in Minutes. Only supported on Premium SKUs.
- rdb
Backup NumberMax Snapshot Count The maximum number of snapshots that can be created as a backup.
- rdb
Storage StringConnection String The Connection String to the Storage Account. Only supported for Premium SKUs.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.