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

dokploy_mongo (Data Source)

Look up a Dokploy mongo service by id, or by name within an environment. The data source does not expose the database password. It exposes each other credential attribute as sensitive.

Example Usage

terraform
data "dokploy_mongo" "example" {
  id = "your-mongo-id"
}

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

Schema

Optional

  • environment_id (String) Id of the environment to search. Required with name.
  • id (String) MongoDB service id. Set this attribute, or set both environment_id and name.
  • name (String) Exact mongo service name. The lookup searches within environment_id and errors when zero or many mongo services match.

Read-Only

  • app_name (String) Internal Dokploy app name.
  • args (List of String) Arguments for the container command, if any.
  • command (String) Container command override, if any.
  • cpu_limit (String) Hard CPU limit in nano-CPUs, if any.
  • cpu_reservation (String) Reserved CPU in nano-CPUs, if any.
  • created_at (String) Creation timestamp.
  • database_user (String) Database user.
  • docker_image (String) Docker image.
  • external_port (Number) Exposed host port, if any.
  • memory_limit (String) Hard memory limit in bytes, if any.
  • memory_reservation (String) Reserved memory in bytes, if any.
  • replica_sets (Boolean) Whether MongoDB runs as a replica set.
  • replicas (Number) Number of container replicas.
  • status (String) Service status.