Skip to content

Commit

Permalink
feat: add organization variables
Browse files Browse the repository at this point in the history
  • Loading branch information
KoLiBer committed Sep 10, 2024
1 parent 577823a commit 4fc149d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions root.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ resource "gitlab_group" "root" {
locals {
org_id = try(gitlab_group.root[0].id, var.id)
}

resource "gitlab_group_variable" "this" {
for_each = var.variables

group = local.org_id
environment_scope = coalesce(each.value.scope, "*")
key = each.key
value = each.value.value
masked = can(regex("\\A\\w{8,}\\z", each.value.value))
protected = each.value.scope != null
variable_type = each.value.type
}
11 changes: 11 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ variable "desc" {
description = "Organization Description"
}

variable "variables" {
type = map(object({
type = string
value = string
scope = optional(string)
}))
default = {}
sensitive = false
description = "Organization Variables"
}

variable "groups" {
type = map(object({
path = string
Expand Down

0 comments on commit 4fc149d

Please sign in to comment.