Updates to gitlab_project_variable force replacement if hidden is not configured

Bug Report

If you use gitlab_project_variable and don't configure the hidden attribute, it forces a replacement on every update.

Relevant Terraform Configuration

This is what we use in the community forks meta project

resource "gitlab_project_access_token" "onboarding_triage" {
  name         = "Onboarding triage"
  project      = data.gitlab_project.onboarding.id
  access_level = "developer"

  scopes = ["api"]

  rotation_configuration = {
    expiration_days    = 30
    rotate_before_days = 14
  }
}

resource "gitlab_project_variable" "onboarding_triage" {
  key         = "TRIAGE_GITLAB_API_TOKEN"
  description = "Onboarding triage"
  project     = data.gitlab_project.meta.id
  value       = gitlab_project_access_token.onboarding_triage.token
  masked      = true
  protected   = true
}

Relevant Terraform Command

tofu apply

Relevant Log Output

image

Edited Jan 06, 2026 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading