The gitlab_project_tag
resource allows to manage the lifecycle of a tag in a project.
Upstream API: GitLab API docs
# Create a project for the tag to use
resource "gitlab_project" "example" {
name = "example"
description = "An example project"
namespace_id = gitlab_group.example.id
}
resource "gitlab_project_tag" "example" {
name = "example"
ref = "main"
project = gitlab_project.example.id
}
name
(String) The name of a tag.project
(String) The ID or URL-encoded path of the project owned by the authenticated user.ref
(String) Create tag using commit SHA, another tag name, or branch name. This attribute is not available for imported resources.message
(String) The message of the annotated tag.commit
(Set of Object) The commit associated with the tag. (see below for nested schema)id
(String) The ID of this resource.protected
(Boolean) Bool, true if tag has tag protection.release
(Set of Object) The release associated with the tag. (see below for nested schema)target
(String) The unique id assigned to the commit by Gitlab.commit
Read-Only:
author_email
(String)author_name
(String)authored_date
(String)committed_date
(String)committer_email
(String)committer_name
(String)id
(String)message
(String)parent_ids
(Set of String)short_id
(String)title
(String)release
Read-Only:
description
(String)tag_name
(String)Import is supported using the following syntax:
# Gitlab project tags can be imported with a key composed of `<project_id>:<tag_name>`, e.g.
terraform import gitlab_project_tag.example "12345:develop"
# NOTE: the `ref` attribute won't be available for imported `gitlab_project_tag` resources.