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/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" } } + diff --git a/repolist.tf b/repolist.tf index 7f8c645..ec6e7c9 100644 --- a/repolist.tf +++ b/repolist.tf @@ -19,15 +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" - branch = { - name = "main" - } + custom_branch_policies = false } diff --git a/varfiles/default.tfvars b/varfiles/default.tfvars index 4290323..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" @@ -40,6 +41,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" 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"