Skip to content

Latest commit

 

History

History
83 lines (62 loc) · 3.06 KB

redis.md

File metadata and controls

83 lines (62 loc) · 3.06 KB
page_title cozystack_redis Resource - cozystack
subcategory
description A Cozystack managed Redis instance, deployed inside a tenant namespace.

cozystack_redis (Resource)

A Cozystack managed Redis instance, deployed inside a tenant namespace.

Example Usage

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"
  }
}

Schema

Required

  • name (String) Redis instance name (metadata.name). Immutable.
  • namespace (String) Tenant namespace the instance is created in. Immutable.

Optional

  • 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. Overrides resources_preset for any field set. (see below for nested schema)
  • resources_preset (String) Sizing preset applied when resources is 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 (v7 or v8).
  • wait_for_ready (Boolean) Block on create/update until the Ready condition is true and any server-generated outputs the resource exposes are readable.
  • wait_timeout (String) Maximum time to wait when wait_for_ready is 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.

Read-Only

  • chart_version (String) Deployed chart version (status.version).
  • id (String) Synthetic identifier in the form namespace/name.
  • ready (Boolean) Whether the instance's Ready condition is true.
  • uid (String) Server-assigned object UID (metadata.uid).

Nested Schema for resources

Optional:

  • cpu (String) CPU available to each replica (quantity, e.g. 500m).
  • memory (String) Memory available to each replica (quantity, e.g. 512Mi).

Import

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