skip to content
wihan.dev
view as markdown
browse the dokploy docs

dokploy_libsql (Data Source)

Look up a Dokploy libsql service (a distributed SQLite / sqld database) by id, or by name within an environment. The data source does not expose the database password.

~> Dokploy does not enforce name uniqueness within an environment. If more than one libsql service shares a name, this data source fails instead of a guess. Look the record up by id in that case.

Example Usage

terraform
data "dokploy_libsql" "example" {
  id = "your-libsql-id"
}

# By name, within an environment.
data "dokploy_libsql" "by_name" {
  environment_id = data.dokploy_environment.production.id
  name           = "db"
}

Schema

Optional

  • environment_id (String) Id of the environment to search for a lookup by name. Required together with name.
  • id (String) LibSQL service id. Set it for a lookup by id, or leave it unset and set name and environment_id.
  • name (String) Display name of the libsql service. Set exactly one of id or name. name requires environment_id.

Read-Only

  • app_name (String) Internal Dokploy app name. The server always generates it.
  • command (String) Container command override, if any.
  • cpu_limit (String) Hard CPU limit in nano-CPUs, for example "500000000" for half a CPU.
  • cpu_reservation (String) Reserved CPU in nano-CPUs, for example "250000000" for a quarter CPU.
  • created_at (String) Creation timestamp from the server.
  • database_user (String) LibSQL database user.
  • description (String) Free-form description.
  • docker_image (String) LibSQL Docker image.
  • enable_namespaces (Boolean) Whether sqld namespaces, the multi-database mode, are enabled.
  • env (String) Extra environment variables in the native Dokploy multiline KEY=value format.
  • external_admin_port (Number) Host port for the libsql admin interface, if any.
  • external_grpc_port (Number) Host port for the libsql gRPC replication interface, if any.
  • external_port (Number) Host port for the libsql HTTP interface, if any.
  • memory_limit (String) Hard memory limit in bytes, for example "536870912" for 512 MiB.
  • memory_reservation (String) Reserved memory in bytes, for example "268435456" for 256 MiB.
  • replicas (Number) Number of container replicas.
  • server_id (String) Id of the remote server that runs the service, if not the Dokploy host.
  • sqld_node (String) Topology role: primary or replica.
  • sqld_primary_url (String) URL of the primary sqld node. Set only when sqld_node is replica.
  • status (String) Service status from Dokploy.