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

dokploy_destination (Data Source)

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

Users usually create a shared backup target once and reference it from several projects:

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

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

~> The data source does not expose the credentials. access_key and secret_access_key exist on the dokploy_destination resource, but not here, by design. A consumer needs only the id, and a copy of an access key in the state of each consumer widens its exposure with no gain.

~> Dokploy does not enforce name uniqueness. If two destinations share a name, this data source fails instead of a guess. Look the record up by id in that case.

Example Usage

terraform
# 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 purpose of a lookup: a shared S3 target that exists once and
# that several projects reference.
resource "dokploy_backup" "db" {
  service_id      = dokploy_postgres.main.id
  service_type    = "postgres"
  destination_id  = data.dokploy_destination.backups.id
  database        = "app"
  prefix          = "app/"
  cron_expression = "0 3 * * *"
}

Schema

Optional

  • id (String) Destination id. Set it for a lookup by id, or leave it unset and set name.
  • name (String) Display name as shown in Dokploy. Set exactly one of id or name.

Read-Only

  • additional_flags (List of String) Extra flags for the storage client. Empty when none are set.
  • bucket (String) Bucket name.
  • created_at (String) Creation timestamp from the server.
  • endpoint (String) S3 endpoint URL.
  • provider_name (String) Storage provider label, for example Cloudflare, AWS, or DigitalOcean.
  • region (String) Bucket region.