From e778ad2ab07d618b1a728ad1883270cc59913753 Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Mon, 21 Oct 2024 11:48:42 -0700 Subject: [PATCH 1/3] Update backend.tf --- backend.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/backend.tf b/backend.tf index 4683cb6..aed7620 100644 --- a/backend.tf +++ b/backend.tf @@ -6,3 +6,4 @@ terraform { dynamodb_table = "tf_remote_state" } } + From 556ecd15f75628bb22c436999047ba1e5234b60d Mon Sep 17 00:00:00 2001 From: James Farr Gomez Date: Wed, 23 Oct 2024 09:21:42 -0700 Subject: [PATCH 2/3] tf caching repo (#31) --- varfiles/default.tfvars | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/varfiles/default.tfvars b/varfiles/default.tfvars index 4290323..131d4d0 100644 --- a/varfiles/default.tfvars +++ b/varfiles/default.tfvars @@ -40,6 +40,15 @@ repolist = [ "terraform-tools" ] }, + { + description = "Terraform Caching service" + repo_org = "CSVD" + name = "tf-caching" + is_private = false + repo_topics = [ + "terraform-tools" + ] + }, { description = "morpheus-repos" repo_org = "CSVD" From 717f788fcc13affc6d91b5f32c50b7968ae3ead8 Mon Sep 17 00:00:00 2001 From: David John Arnold Jr Date: Fri, 25 Oct 2024 11:01:55 -0700 Subject: [PATCH 3/3] GitHub workspace (#30) * adding workspaces to current repos * adding environments * updating repolist * Update terraform_codebuild_plan.yaml --- .github/workflows/terraform_codebuild_plan.yaml | 2 +- repolist.tf | 16 ++++++++++++++++ varfiles/default.tfvars | 1 + variables.tf | 1 + versions.tf | 4 ---- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/terraform_codebuild_plan.yaml b/.github/workflows/terraform_codebuild_plan.yaml index 39353a5..55c55a9 100644 --- a/.github/workflows/terraform_codebuild_plan.yaml +++ b/.github/workflows/terraform_codebuild_plan.yaml @@ -7,7 +7,7 @@ on: workflow_dispatch: concurrency: - group: ${{ github.repo }}-${{ vars.terraform_workspace }} + group: ${{ github.repo }}-${{ vars.terraform_workspace }}-codebuild permissions: write-all # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/repolist.tf b/repolist.tf index 90297b0..d729b6c 100644 --- a/repolist.tf +++ b/repolist.tf @@ -16,3 +16,19 @@ module "repo_list" { github_org_teams = local.github_organization_teams } + +module "workspace" { + source = "HappyPathway/workspace/github" + 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 = false + environment = "default" + branch = { + name = "main" + } +} diff --git a/varfiles/default.tfvars b/varfiles/default.tfvars index 131d4d0..1212e7d 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"