dokploy_gitlab_provider (Resource)
A GitLab connection (Git > GitLab): the OAuth application that lets Dokploy list and clone repositories. Applications and composes then use the gitlab source block with this record’s id.
~> A person must authorize the application once in a browser. Terraform stores the OAuth application credentials. Until someone opens Git > GitLab in the Dokploy UI and completes the authorization, Dokploy holds no access token, the dokploy_gitlab_provider data source reports is_configured = false, and a deploy from this provider fails.
~> Dokploy stores and returns secret in cleartext. The attribute is sensitive, so Terraform does not print it, but anyone with API access to the server can read it. The secret_wo companion keeps it out of the Terraform state.
Example Usage
# Register the OAuth application that you created in GitLab
# (User Settings > Applications, or a group application). GitLab needs the
# redirect URI that Dokploy reports back; the default matches the provider's
# endpoint, so most setups leave redirect_uri unset.
resource "dokploy_gitlab_provider" "main" {
name = "my-group"
application_id = var.gitlab_oauth_application_id
group_name = "my-group"
# Write-only: Terraform 1.11 or later. Change the version to send a new secret.
secret_wo = var.gitlab_oauth_secret
secret_wo_version = 1
}
# After the apply, open Git > GitLab in Dokploy and authorize the
# application once. Until then the provider holds no access token.
# A self-hosted GitLab on a private network: gitlab_internal_url is the
# address that the Dokploy server uses to reach it.
resource "dokploy_gitlab_provider" "internal" {
name = "gitlab-internal"
gitlab_url = "https://gitlab.example.com"
gitlab_internal_url = "http://10.0.0.5"
application_id = var.internal_oauth_application_id
secret = var.internal_oauth_secret
}Schema
Required
application_id(String) Application ID of the OAuth application that you created in GitLab.name(String) Display name. Dokploy does not enforce a unique name.
Optional
NOTE: Write-only arguments are supported in Terraform 1.11 and later.
gitlab_internal_url(String) URL that the Dokploy server uses to reach a self-hosted GitLab when it differs fromgitlab_url, for example an address on a private network. If you remove it from the configuration, the provider clears it.gitlab_url(String) URL of the GitLab instance. Defaults tohttps://gitlab.com.group_name(String) GitLab group whose projects Dokploy lists. Omit it to list the projects of the authorizing user. If you remove it from the configuration, the provider clears it.redirect_uri(String) Redirect URI of the OAuth application. Defaults to<endpoint>/api/providers/gitlab/callback, built from the provider’sendpoint. Register the same URI in GitLab.secret(String, Sensitive) Secret of the OAuth application. Set this attribute orsecret_wo.secret_wo(String, Sensitive, Write-only) Write-only form ofsecret. Terraform keeps it out of the plan and the state. It needs Terraform 1.11 or later. Set exactly one ofsecretandsecret_wo. A new value reaches the server only whensecret_wo_versionchanges.secret_wo_version(Number) Version ofsecret_wo. Change it to send the currentsecret_wovalue to the server. It needssecret_wo.
Read-Only
created_at(String) Creation timestamp from the server.git_provider_id(String) Id of the generic git-provider record that owns this GitLab record.id(String) ThegitlabId. Thegitlab.gitlab_idof an application or a compose references it.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# Import by the gitlabId, the id that gitlab.one takes.
terraform import dokploy_gitlab_provider.main c_59BSJGjfG2UAG-cima_