From a2fe8aa4874479bc047acd108f94382414ddb134 Mon Sep 17 00:00:00 2001 From: arnol377 Date: Fri, 25 Oct 2024 13:06:31 -0400 Subject: [PATCH] adding environments --- repolist.tf | 3 ++- varfiles/default.tfvars | 1 + variables.tf | 1 + versions.tf | 4 ---- 4 files changed, 4 insertions(+), 5 deletions(-) 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"