diff --git a/repolist.tf b/repolist.tf index 7f8c645..9674ed1 100644 --- a/repolist.tf +++ b/repolist.tf @@ -19,11 +19,12 @@ module "repo_list" { module "workspace" { source = "HappyPathway/workspace/github" - for_each = tomap({ for repo in var.repolist : repo.name => repo }) + for_each = tomap({ for repo in var.repolist : repo.name => repo if repo.workspace }) runner_group = "229685449397" repo_name = each.value.name repo_org = each.value.repo_org reviewers = 1 + reviewers_users = keys(local.collaborators) protected_branches = true custom_branch_policies = true environment = "default" diff --git a/varfiles/default.tfvars b/varfiles/default.tfvars index 4290323..3b624bd 100644 --- a/varfiles/default.tfvars +++ b/varfiles/default.tfvars @@ -21,6 +21,7 @@ repolist = [ repo_topics = [ "terraform-tools" ] + workspace = true }, { description = "Managing AWS Github Runner Image" diff --git a/variables.tf b/variables.tf index e3276d1..84c49fe 100644 --- a/variables.tf +++ b/variables.tf @@ -12,6 +12,7 @@ variable "repolist" { enforce_prs = optional(bool, false) repo_topics = optional(list(string), ["terraform-workspace"]) is_private = optional(bool, false) + workspace = optional(bool, false) })) default = [] } diff --git a/versions.tf b/versions.tf index 1030799..32b8f4a 100644 --- a/versions.tf +++ b/versions.tf @@ -1,9 +1,5 @@ terraform { required_providers { - random = { - source = "integrations/github" - version = ">= 6.3.0" - } aws = { source = "hashicorp/aws" version = ">= 2.0.0"