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

dokploy_github_provider (Data Source)

Looks up a GitHub App that is registered in Dokploy (Git > GitHub).

Use it so that the github_id of dokploy_application is not a hardcoded opaque id:

terraform
data "dokploy_github_provider" "main" {
  name = "my-org"
}

resource "dokploy_application" "web" {
  github = {
    github_id = data.dokploy_github_provider.main.id
    # ...
  }
}

~> id is the githubId, not the gitProviderId. Dokploy keeps both: git_provider_id is the generic record, and id is the GitHub-specific record. An application references the GitHub-specific record. Validation accepts the wrong id, and the request then fails with an HTTP 500, because only the database layer enforces the foreign key.

~> Terraform cannot create a GitHub App. The Dokploy API has no github.create, and the installation is a browser flow. This data source reads what already exists.

Example Usage

terraform
# Look up the GitHub App by name instead of an opaque id.
data "dokploy_github_provider" "main" {
  name = "my-org"
}

resource "dokploy_application" "web" {
  name           = "web"
  environment_id = dokploy_project.example.production_environment_id

  github = {
    owner      = "my-org"
    repository = "my-app"
    branch     = "master"
    # Use `id`, not `git_provider_id`: an application references the
    # GitHub-specific record.
    github_id = data.dokploy_github_provider.main.id
  }
}

Schema

Optional

  • id (String) The githubId. Set it for a lookup by id, or leave it unset and set name. This is the value that dokploy_application.github.github_id expects.
  • name (String) Provider name as shown in Dokploy. Set exactly one of id or name.

Read-Only

  • created_at (String) Creation timestamp from the server.
  • git_provider_id (String) Id of the generic git-provider record that owns this GitHub App. An application does not reference it.
  • github_url (String) Base URL of a GitHub Enterprise instance, or null for github.com.
  • provider_type (String) Always github for this data source.
  • shared_with_organization (Boolean) Whether the provider is shared with the whole Dokploy organization.