wihan/dev

docs /dokploy / resources

markdown
browse the dokploy docs

dokploy_redis (Resource)

A Redis database service in a Dokploy environment.

Example Usage

resource "dokploy_redis" "example" {
  name              = "app-cache"
  environment_id    = [for e in dokploy_project.example.environments : e.id if e.name == "production"][0]
  database_password = var.db_password # use a sensitive variable
  docker_image      = "redis:8"

  env = <<-EOT
    TZ=UTC
  EOT
}

Schema

Required

  • database_password (String, Sensitive) Redis password. Changing it triggers a redeploy.
  • environment_id (String) Id of the environment this service lives in (see dokploy_project.environments).
  • name (String) Display name of the database service.

Optional

  • app_name (String) Dokploy-internal app name; generated by the server when omitted.
  • deploy_on_change (Boolean) Deploy after create and after changes to deploy-triggering attributes. Defaults to true.
  • deployment_timeout (String) How long to wait for a triggered deployment to reach a terminal status, as a Go duration string. Defaults to "15m". On timeout the apply fails but the server-side deployment keeps running.
  • description (String) Free-form description.
  • detach_dokploy_network (Boolean) Detach the shared dokploy-network from this service. Defaults to false. Only meaningful together with network_ids; applied on the next deploy.
  • docker_image (String) Redis docker image, e.g. redis:8. Server default when omitted.
  • env (String) Extra environment variables in Dokploy’s native multiline KEY=value format. Use Terraform sensitive variables for secret values. Omitting this attribute and setting it to “” are indistinguishable on read — both come back null. Use omission, not “”, to clear it.
  • external_port (Number) Host port to expose Redis on. Unset keeps the database internal-only.
  • network_ids (Set of String) Ids of Docker networks (Dokploy network records) to attach this service to. Applied on the next deploy. Omit to keep only the default dokploy-network. An empty set is not valid - omit the attribute instead.
  • server_id (String) Remote server to run the service on. Defaults to the Dokploy host.

Read-Only

  • created_at (String) Creation timestamp (server-side).
  • id (String) Redis service id.
  • status (String) Service status reported by Dokploy.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

terraform import dokploy_redis.example <redisId>