wihan/dev

docs /dokploy / data sources

markdown
browse the dokploy docs

dokploy_destination (Data Source)

Looks up an S3-compatible backup destination already registered in Dokploy.

A shared backup target is typically created once and referenced from several projects:

data "dokploy_destination" "backups" {
  name = "cloudflare-r2"
}

resource "dokploy_backup" "db" {
  destination_id = data.dokploy_destination.backups.id
  # ...
}

~> Credentials are not exposed. access_key and secret_access_key exist on the dokploy_destination resource but deliberately not here: consumers need only the id, and copying an access key into every consumer’s state widens its blast radius for no gain.

~> Dokploy does not enforce name uniqueness. If two destinations share a name this data source fails rather than picking one; look the record up by id in that case.

Example Usage

# Look up a backup destination that already exists in Dokploy, by name.
data "dokploy_destination" "backups" {
  name = "cloudflare-r2"
}

# Or by id, when the name is ambiguous or you already hold the id.
data "dokploy_destination" "by_id" {
  id = "V1StGXR8_Z5jdHi6B-myT"
}

# The usual reason to look one up: a shared S3 target created once and
# referenced from several projects.
resource "dokploy_backup" "db" {
  service_id     = dokploy_postgres.main.id
  service_type   = "postgres"
  destination_id = data.dokploy_destination.backups.id
  database       = "app"
  prefix         = "app/"
  schedule       = "0 3 * * *"
}

Schema

Optional

  • id (String) Destination id. Set this to look it up by id, or leave it unset and set name.
  • name (String) Display name as shown in Dokploy. Exactly one of id or name must be set.

Read-Only

  • additional_flags (List of String) Extra flags passed to the underlying storage client. Empty when none are set.
  • bucket (String) Bucket name.
  • created_at (String) Creation timestamp (server-side).
  • endpoint (String) S3 endpoint URL.
  • provider_name (String) Storage provider label, e.g. Cloudflare, AWS, DigitalOcean.
  • region (String) Bucket region.