|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "gitlab_project_tag Resource - terraform-provider-gitlab" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + The gitlab_project_tag resource allows to manage the lifecycle of a tag in a project. |
| 7 | + Upstream API : GitLab API docs https://docs.gitlab.com/ee/api/tags.html |
| 8 | +--- |
| 9 | + |
| 10 | +# gitlab_project_tag (Resource) |
| 11 | + |
| 12 | +The `gitlab_project_tag` resource allows to manage the lifecycle of a tag in a project. |
| 13 | + |
| 14 | +**Upstream API** : [GitLab API docs](https://docs.gitlab.com/ee/api/tags.html) |
| 15 | + |
| 16 | +## Example Usage |
| 17 | + |
| 18 | +```terraform |
| 19 | +# Create a project for the tag to use |
| 20 | +resource "gitlab_project" "example" { |
| 21 | + name = "example" |
| 22 | + description = "An example project" |
| 23 | + namespace_id = gitlab_group.example.id |
| 24 | +} |
| 25 | +
|
| 26 | +resource "gitlab_project_tag" "example" { |
| 27 | + name = "example" |
| 28 | + ref = "main" |
| 29 | + project = gitlab_project.example.id |
| 30 | +} |
| 31 | +``` |
| 32 | + |
| 33 | +<!-- schema generated by tfplugindocs --> |
| 34 | +## Schema |
| 35 | + |
| 36 | +### Required |
| 37 | + |
| 38 | +- **name** (String) The name of a tag. |
| 39 | +- **project** (String) The ID or URL-encoded path of the project owned by the authenticated user. |
| 40 | +- **ref** (String) Create tag using commit SHA, another tag name, or branch name. This attribute is not available for imported resources. |
| 41 | + |
| 42 | +### Optional |
| 43 | + |
| 44 | +- **id** (String) The ID of this resource. |
| 45 | +- **message** (String) Creates annotated tag. |
| 46 | + |
| 47 | +### Read-Only |
| 48 | + |
| 49 | +- **commit** (Set of Object) The commit associated with the tag. (see [below for nested schema](#nestedatt--commit)) |
| 50 | +- **protected** (Boolean) Bool, true if tag has tag protection. |
| 51 | +- **release** (Set of Object) The release associated with the tag. (see [below for nested schema](#nestedatt--release)) |
| 52 | +- **target** (String) The unique id assigned to the commit by Gitlab. |
| 53 | + |
| 54 | +<a id="nestedatt--commit"></a> |
| 55 | +### Nested Schema for `commit` |
| 56 | + |
| 57 | +Read-Only: |
| 58 | + |
| 59 | +- **author_email** (String) |
| 60 | +- **author_name** (String) |
| 61 | +- **authored_date** (String) |
| 62 | +- **committed_date** (String) |
| 63 | +- **committer_email** (String) |
| 64 | +- **committer_name** (String) |
| 65 | +- **id** (String) |
| 66 | +- **message** (String) |
| 67 | +- **parent_ids** (Set of String) |
| 68 | +- **short_id** (String) |
| 69 | +- **title** (String) |
| 70 | + |
| 71 | + |
| 72 | +<a id="nestedatt--release"></a> |
| 73 | +### Nested Schema for `release` |
| 74 | + |
| 75 | +Read-Only: |
| 76 | + |
| 77 | +- **description** (String) |
| 78 | +- **tag_name** (String) |
| 79 | + |
| 80 | +## Import |
| 81 | + |
| 82 | +Import is supported using the following syntax: |
| 83 | + |
| 84 | +```shell |
| 85 | +# Gitlab project tags can be imported with a key composed of `<project_id>:<tag_name>`, e.g. |
| 86 | +terraform import gitlab_project_tag.example "12345:develop" |
| 87 | + |
| 88 | +# NOTE: the `ref` attribute won't be available for imported `gitlab_project_tag` resources. |
| 89 | +``` |
0 commit comments