Skip to content

Commit 3f20e65

Browse files
committed
gitlab_project_id keep backward compatibility
1 parent bb2638c commit 3f20e65

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

modules/gitlab/main.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
locals {
2+
gitlab_project_ids = toset(concat(var.gitlab_project_ids, var.gitlab_project_id != null ? [var.gitlab_project_id] : []))
3+
}
4+
15
data "gitlab_project" "this" {
2-
for_each = toset(var.gitlab_project_ids)
6+
for_each = local.gitlab_project_ids
37
id = each.value
48
}
59

modules/gitlab/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ variable "gitlab_project_ids" {
22
type = list(string)
33
}
44

5+
variable "gitlab_project_id" {
6+
type = string
7+
description = "Deprecated: Use gitlab_project_ids instead"
8+
default = null
9+
}
10+
511
variable "gitlab_environment" {
612
type = string
713
default = "*"

0 commit comments

Comments
 (0)