Skip to content

walrus-catalog/terraform-azure-redis

Repository files navigation

Azure Redis Cache

Terrafom module to deploy a Redis Cache on Azure Cloud.

  • Support standalone(one read-write instance) and replication(one read-write instance and multiple read-only instances, for read write splitting).

Usage

module "redis" {
  source = "..."

  infrastructure = {
    resource_group  = "..."
    virtual_network = "..."
    subnet          = "..."
    publicly_accessible = true
  }
}

Examples

Contributing

Please read our contributing guide if you're interested in contributing to Walrus template.

Requirements

Name Version
terraform >= 1.0
azurerm >= 3.88.0
random >= 3.5.1

Providers

Name Version
azurerm >= 3.88.0
random >= 3.5.1

Modules

No modules.

Resources

Name Type
azurerm_redis_cache.primary resource
azurerm_redis_cache.secondary resource
azurerm_redis_linked_server.link resource
azurerm_resource_group.default resource
random_string.name_suffix resource
azurerm_resource_group.selected data source
azurerm_subnet.selected data source
azurerm_virtual_network.selected data source

Inputs

Name Description Type Default Required
architecture Specify the deployment architecture, select from standalone or replication. string "standalone" no
context Receive contextual information. When Walrus deploys, Walrus will inject specific contextual information into this field.

Examples:
context:
project:
name: string
id: string
environment:
name: string
id: string
resource:
name: string
id: string
map(any) {} no
engine_version Specify the deployment engine version of the Redis Server to use. Possible values are 6.0, and 4.0. string "6.0" no
infrastructure Specify the infrastructure information for deploying.

Examples:
infrastructure:
resource_group: string, optional # the resource group name where to deploy the Redis Server
virtual_network: string, optional # the virtual network name where to deploy the Redis Server
subnet: string, optional # the subnet name under the virtual network where to deploy the Redis Server
publicly_accessible: bool # whether the Redis service is publicly accessible
object({
resource_group = optional(string)
virtual_network = optional(string)
subnet = optional(string)
publicly_accessible = optional(bool, false)
})
{
"publicly_accessible": false
}
no
replication_readonly_replicas Specify the number of read-only replicas under the replication deployment. number 1 no
resources Specify the computing resources.
Please note that the resources class is only available for the Basic, Standard, and Premium pricing tiers.
See https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-overview#pricing for more information.
Examples:
resources:
class: string, optional # sku
object({
class = optional(string, "Basic")
})
{
"class": "Basic"
}
no
storage The storage size of the Redis cache. 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
object({
size = optional(number, 1)
})
{
"size": 1
}
no

Outputs

Name Description
address The address, a string only has host, might be a comma separated string or a single string.
address_readonly The readonly address, a string only has host, might be a comma separated string or a single string.
connection The connection, a string combined host and port, might be a comma separated string or a single string.
connection_readonly The readonly connection, a string combined host and port, might be a comma separated string or a single string.
context The input context, a map, which is used for orchestration.
password The password of the account to access the database.
passwords_readonly The readonly passwords of the account to access the database.
port The port of the service.
refer The refer, a map, including hosts, ports and account, which is used for dependencies or collaborations.