|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "gitlab_value_stream_analytics Resource - terraform-provider-gitlab" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + The gitlab_value_stream_analytics resource allows to manage the lifecycle of value stream analytics. |
| 7 | + -> This resource requires a GitLab Enterprise instance with a Premium license to create custom value stream analytics. |
| 8 | + Upstream API: GitLab GraphQL API docs https://docs.gitlab.com/ee/api/graphql/reference/#mutationvaluestreamcreate |
| 9 | +--- |
| 10 | + |
| 11 | +# gitlab_value_stream_analytics (Resource) |
| 12 | + |
| 13 | +The `gitlab_value_stream_analytics` resource allows to manage the lifecycle of value stream analytics. |
| 14 | + |
| 15 | +-> This resource requires a GitLab Enterprise instance with a Premium license to create custom value stream analytics. |
| 16 | + |
| 17 | +**Upstream API**: [GitLab GraphQL API docs](https://docs.gitlab.com/ee/api/graphql/reference/#mutationvaluestreamcreate) |
| 18 | + |
| 19 | +## Example Usage |
| 20 | + |
| 21 | +```terraform |
| 22 | +resource "gitlab_value_stream_analytics" "project" { |
| 23 | + name = "TEST" |
| 24 | + project_full_path = "test/project" |
| 25 | + stages = [ |
| 26 | + { |
| 27 | + name = "Issue" |
| 28 | + custom = false |
| 29 | + hidden = false |
| 30 | + }, |
| 31 | + { |
| 32 | + name = "Issue Labels" |
| 33 | + custom = true |
| 34 | + hidden = false |
| 35 | + start_event_identifier = "ISSUE_LABEL_ADDED" |
| 36 | + start_event_label_id = "gid://gitlab/ProjectLabel/0" |
| 37 | + end_event_identifier = "ISSUE_LABEL_REMOVED" |
| 38 | + end_event_label_id = "gid://gitlab/ProjectLabel/1" |
| 39 | + } |
| 40 | + ] |
| 41 | +} |
| 42 | +
|
| 43 | +resource "gitlab_value_stream_analytics" "group" { |
| 44 | + name = "TEST" |
| 45 | + group_full_path = "test/group" |
| 46 | + stages = [ |
| 47 | + { |
| 48 | + name = "Issue" |
| 49 | + custom = false |
| 50 | + hidden = false |
| 51 | + }, |
| 52 | + { |
| 53 | + name = "Issue Labels" |
| 54 | + custom = true |
| 55 | + hidden = false |
| 56 | + start_event_identifier = "ISSUE_LABEL_ADDED" |
| 57 | + start_event_label_id = "gid://gitlab/GroupLabel/0" |
| 58 | + end_event_identifier = "ISSUE_LABEL_REMOVED" |
| 59 | + end_event_label_id = "gid://gitlab/GroupLabel/1" |
| 60 | + } |
| 61 | + ] |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +<!-- schema generated by tfplugindocs --> |
| 66 | +## Schema |
| 67 | + |
| 68 | +### Required |
| 69 | + |
| 70 | +- `name` (String) The name of the value stream |
| 71 | +- `stages` (Attributes Set) Stages of the value stream (see [below for nested schema](#nestedatt--stages)) |
| 72 | + |
| 73 | +### Optional |
| 74 | + |
| 75 | +- `group_full_path` (String) Full path of the group the value stream is created in. **One of `group_full_path` OR `project_full_path` is required.** |
| 76 | +- `project_full_path` (String) Full path of the project the value stream is created in. **One of `group_full_path` OR `project_full_path` is required.** |
| 77 | + |
| 78 | +### Read-Only |
| 79 | + |
| 80 | +- `id` (String) The Terraform ID of the value stream in the format of `group:<group_full_path>:<id>` or `project:<project_full_path>:<id>`. |
| 81 | + |
| 82 | +<a id="nestedatt--stages"></a> |
| 83 | +### Nested Schema for `stages` |
| 84 | + |
| 85 | +Required: |
| 86 | + |
| 87 | +- `name` (String) The name of the value stream stage. |
| 88 | + |
| 89 | +Optional: |
| 90 | + |
| 91 | +- `custom` (Boolean) Boolean whether the stage is customized. If false, it assigns a built-in default stage by name. |
| 92 | +- `end_event_identifier` (String) End event identifier. Valid values are: `CODE_STAGE_START`, `ISSUE_CLOSED`, `ISSUE_CREATED`, `ISSUE_DEPLOYED_TO_PRODUCTION`, `ISSUE_FIRST_ADDED_TO_BOARD`, `ISSUE_FIRST_ADDED_TO_ITERATION`, `ISSUE_FIRST_ASSIGNED_AT`, `ISSUE_FIRST_ASSOCIATED_WITH_MILESTONE`, `ISSUE_FIRST_MENTIONED_IN_COMMIT`, `ISSUE_LABEL_ADDED`, `ISSUE_LABEL_REMOVED`, `ISSUE_LAST_EDITED`, `ISSUE_STAGE_END`, `MERGE_REQUEST_CLOSED`, `MERGE_REQUEST_CREATED`, `MERGE_REQUEST_FIRST_ASSIGNED_AT`, `MERGE_REQUEST_FIRST_COMMIT_AT`, `MERGE_REQUEST_FIRST_DEPLOYTED_TO_PRODUCTION`, `MERGE_REQUEST_LABEL_ADDED`, `MERGE_REQUEST_LABEL_REMOVED`, `MERGE_REQUEST_LAST_BUILD_FINISHED`, `MERGE_REQUEST_LAST_BUILD_STARTED`, `MERGE_REQUEST_LAST_EDITED`, `MERGE_REQUEST_MERGED`, `MERGE_REQUEST_REVIEWER_FIRST_ASSIGNED`, `MERGE_REQUEST_PLAN_STAGE_START` |
| 93 | +- `end_event_label_id` (String) Label ID associated with the end event identifier. In the format of `gid://gitlab/GroupLabel/<id>` or `gid://gitlab/ProjectLabel/<id>` |
| 94 | +- `hidden` (Boolean) Boolean whether the stage is hidden, GitLab provided default stages are hidden by default. |
| 95 | +- `start_event_identifier` (String) Start event identifier. Valid values are: `CODE_STAGE_START`, `ISSUE_CLOSED`, `ISSUE_CREATED`, `ISSUE_DEPLOYED_TO_PRODUCTION`, `ISSUE_FIRST_ADDED_TO_BOARD`, `ISSUE_FIRST_ADDED_TO_ITERATION`, `ISSUE_FIRST_ASSIGNED_AT`, `ISSUE_FIRST_ASSOCIATED_WITH_MILESTONE`, `ISSUE_FIRST_MENTIONED_IN_COMMIT`, `ISSUE_LABEL_ADDED`, `ISSUE_LABEL_REMOVED`, `ISSUE_LAST_EDITED`, `ISSUE_STAGE_END`, `MERGE_REQUEST_CLOSED`, `MERGE_REQUEST_CREATED`, `MERGE_REQUEST_FIRST_ASSIGNED_AT`, `MERGE_REQUEST_FIRST_COMMIT_AT`, `MERGE_REQUEST_FIRST_DEPLOYTED_TO_PRODUCTION`, `MERGE_REQUEST_LABEL_ADDED`, `MERGE_REQUEST_LABEL_REMOVED`, `MERGE_REQUEST_LAST_BUILD_FINISHED`, `MERGE_REQUEST_LAST_BUILD_STARTED`, `MERGE_REQUEST_LAST_EDITED`, `MERGE_REQUEST_MERGED`, `MERGE_REQUEST_REVIEWER_FIRST_ASSIGNED`, `MERGE_REQUEST_PLAN_STAGE_START` |
| 96 | +- `start_event_label_id` (String) Label ID associated with the start event identifier. In the format of `gid://gitlab/GroupLabel/<id>` or `gid://gitlab/ProjectLabel/<id>` |
| 97 | + |
| 98 | +Read-Only: |
| 99 | + |
| 100 | +- `id` (String) The ID of the value stream stage. |
| 101 | + |
| 102 | +## Import |
| 103 | + |
| 104 | +Starting in Terraform v1.5.0 you can use an [import block](https://developer.hashicorp.com/terraform/language/import) to import `gitlab_value_stream_analytics`. For example: |
| 105 | +```terraform |
| 106 | +import { |
| 107 | + to = gitlab_value_stream_analytics.example |
| 108 | + id = "see CLI command below for ID" |
| 109 | +} |
| 110 | +``` |
| 111 | + |
| 112 | +Import using the CLI is supported using the following syntax: |
| 113 | + |
| 114 | +```shell |
| 115 | +# Gitlab value stream analytics can be imported with a key composed of `<full_path_type>:<full_path>:<value_stream_id>`, e.g. |
| 116 | +terraform import gitlab_value_stream_analytics.group "group:people/engineers:42" |
| 117 | + |
| 118 | +terraform import gitlab_value_stream_analytics.project "project:projects/sample:43" |
| 119 | +``` |
0 commit comments