| page_title | cozystack_redis Resource - cozystack |
|---|---|
| subcategory | |
| description | A Cozystack managed Redis instance, deployed inside a tenant namespace. |
A Cozystack managed Redis instance, deployed inside a tenant namespace.
resource "cozystack_redis" "cache" {
name = "cache"
namespace = "tenant-root"
replicas = 2
size = "2Gi"
version = "v8"
auth_enabled = true
}
# Size with an explicit request instead of a preset.
resource "cozystack_redis" "sized" {
name = "sized-cache"
namespace = "tenant-root"
resources = {
cpu = "500m"
memory = "512Mi"
}
}name(String) Redis instance name (metadata.name). Immutable.namespace(String) Tenant namespace the instance is created in. Immutable.
auth_enabled(Boolean) Generate a password and require authentication.external(Boolean) Enable external access from outside the cluster.replicas(Number) Number of Redis replicas.resources(Attributes) Explicit CPU and memory per replica. Overridesresources_presetfor any field set. (see below for nested schema)resources_preset(String) Sizing preset applied whenresourcesis omitted (e.g.t1.nano).size(String) Persistent volume size for application data (quantity, e.g.1Gi).storage_class(String) StorageClass used to store the data. Changing a value set here replaces the object, because an existing volume is never migrated to another class. Removing the attribute from the configuration does not: the object keeps its volumes and the recorded class reverts to the default.version(String) Redis major version to deploy (v7orv8).wait_for_ready(Boolean) Block on create/update until theReadycondition is true and any server-generated outputs the resource exposes are readable.wait_timeout(String) Maximum time to wait whenwait_for_readyis set (Go duration, e.g.10m). Readiness and outputs share this budget; outputs that never appear leave a warning and their attributes stay null until the next refresh.
chart_version(String) Deployed chart version (status.version).id(String) Synthetic identifier in the formnamespace/name.ready(Boolean) Whether the instance'sReadycondition is true.uid(String) Server-assigned object UID (metadata.uid).
Optional:
cpu(String) CPU available to each replica (quantity, e.g.500m).memory(String) Memory available to each replica (quantity, e.g.512Mi).
Import is supported using the following syntax:
The terraform import command can be used, for example:
# Redis instances are imported as "<namespace>/<name>".
terraform import cozystack_redis.cache tenant-root/cache