Skip to content

Add protected tag support

As a Workshop customer, I would like to be able to set protected tags in IaC, So I may better control the tags I use to trigger release generation and/or deployment.

Solution

(Just dropping this in - Can be addressed later in the customer config CI/CD component.)

The following block shows setting via Terraform:

resource "gitlab_tag_protection" "deploy_protection" {
  for_each = module.yer_projects.created_projects

  project             = each.value.id
  tag                 = "v*"
  create_access_level = "maintainer"

  lifecycle {
    # tag protections are always recreated, so create first to
    # ensure a failure in create doesnt leave the tag unprotected
    create_before_destroy = true
  }
}

Resulting in:

image