skip to content
wihan/dev
markdown
browse the dokploy docs

dokploy_gitlab_provider (Data Source)

Looks up a GitLab connection that is registered in Dokploy (Git > GitLab), so that the gitlab source of an application or a compose does not hold a hardcoded id:

terraform
data "dokploy_gitlab_provider" "main" {
  name = "my-group"
}

resource "dokploy_application" "web" {
  gitlab = {
    gitlab_id = data.dokploy_gitlab_provider.main.id
    # ...
  }
}

~> id is the gitlabId, not the gitProviderId. An application references the GitLab-specific record.

~> is_configured is false until a person completes the OAuth authorization in the Dokploy UI. A deploy from an unconfigured provider fails.

Example Usage

terraform
# Look up a GitLab connection that already exists in Dokploy, by name.
data "dokploy_gitlab_provider" "main" {
  name = "my-group"
}

# Deploy an application from a GitLab project through it.
resource "dokploy_application" "api" {
  name           = "api"
  environment_id = dokploy_project.app.production_environment_id

  gitlab = {
    gitlab_id      = data.dokploy_gitlab_provider.main.id
    owner          = "my-group"
    repository     = "api"
    branch         = "main"
    project_id     = 12345678
    path_namespace = "my-group/api"
  }
}

Schema

Optional

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

Read-Only

  • application_id (String) Application ID of the OAuth application.
  • created_at (String) Creation timestamp from the server.
  • git_provider_id (String) Id of the generic git-provider record.
  • gitlab_url (String) URL of the GitLab instance.
  • is_configured (Boolean) Whether the OAuth authorization completed and Dokploy holds an access token.
  • shared_with_organization (Boolean) Whether the provider is shared with the whole organization.