Modular Terraform layout for Azure Managed Redis with supporting networking and Private Link plumbing.
flowchart TB
subgraph RG["Resource group — rg-dev"]
subgraph VNet["Virtual network — vnet-dev 10.0.0.0/16"]
APP["subnet-app-dev — app / client tier"]
SPE["subnet-redis-dev — private endpoint subnet"]
end
REDIS["Azure Managed Redis — redis-dev"]
PE["Private endpoint — pe-redis-dev"]
end
SPE --> PE
PE -.->|Private Link PSC| REDIS
APP -.->|intended client access| PE
- IaC with reusable modules and a per-environment root (currently
env/dev). - Networking: resource group, VNet, and subnets split for workload vs. private endpoint placement.
- Data: Azure Managed Redis (
azurerm_managed_redis) with an example SKU (Balanced_B2). - Private connectivity: Private endpoint module targeting Private Link access patterns for Redis traffic inside the VNet.
| Area | Choice |
|---|---|
| IaC | Terraform, azurerm provider 4.72.0 |
| State | Local backend (remote backend planned) |
| Region | Configurable (default southeastasia) |
| Data plane | Azure Managed Redis |
| Path | Role |
|---|---|
env/dev/main.tf |
Dev root: wires RG, VNet, subnets, Redis, private endpoint |
env/dev/variables.tf |
Root variables (e.g. location) |
module/resource_group |
Resource group |
module/virtual_network |
Virtual network / address space |
module/subnet |
Subnet (reused for app-facing and Redis PE subnets) |
module/managed_redis |
Azure Managed Redis instance |
module/private_endpoint |
Private endpoint + private service connection |
- Terraform 1.x (compatible with your lockfile under
env/dev/.terraform.lock.hcl). - Azure CLI and an Azure subscription with rights to create the resources above.
- Optional: an Azure Storage account (and IAM) if you later move state to an
azurermremote backend.
| Date | Delivered |
|---|---|
| 2026-05-13 | dev / stage environment split (dev wired); RG, VNet, subnet modules |
| 2026-05-13 | Managed Redis module, private endpoint module, readme.md refresh |
- State: Root config uses local state until Azure portal access is available; switch to a remote backend (for example Azure Storage + state lock) when you can manage cloud-side resources comfortably.
env/stage: Stage layout is part of the design direction; add a sibling root underenv/stagemirroringenv/devwhen you are ready to parameterize it.
- Azure sign-in — Run
az loginand confirm the intended subscription withaz account show. Stale sessions or the wrong default subscription are the most common cause of “works on my machine” drift. - Provider registration — This repo sets
resource_provider_registrations = "none"on the provider. If Terraform reports missing resource providers, either pre-register namespaces in the subscription or relax that setting per azurerm provider docs. - Networking / Private Link — If connectivity to Redis via private endpoint fails, verify subnet delegation requirements for your chosen Redis SKU, DNS (private DNS zones if you add them later), and that the private service connection targets the Managed Redis resource ID (not a subnet) in your final wiring.