diff --git a/main.tf b/main.tf index 5a6a546..2a467c1 100644 --- a/main.tf +++ b/main.tf @@ -1,12 +1,29 @@ locals { collaborators = { - naray007 = "write", - morga471 = "write", - lolli001 = "write", - gomez385 = "write" + naray007 = "admin", + morga471 = "admin", + lolli001 = "admin", + gomez385 = "admin" } } +# Add a team to the organization +resource "github_team" "team" { + name = "csvd-automation" +} + + +# resource "github_team_members" "members" { +# team_id = github_team.team.id +# dynamic members { +# for_each = tomap(local.collaborators) +# content { +# username = members.key +# role = "member" +# } +# } +# } + module "elastic_beanstalk" { source = "git@github.e.it.census.gov:CSVD/terraform-github-repo" #github_codeowners_team = "CSVD" @@ -21,6 +38,7 @@ module "elastic_beanstalk" { create_codeowners = false enforce_prs = false collaborators = local.collaborators + admin_teams = [github_team.team.name] } @@ -37,7 +55,8 @@ module "win_image_pipeline" { force_name = true create_codeowners = false enforce_prs = false - collaborators = merge(local.collaborators, { garri325 = "write" }) + collaborators = merge(local.collaborators, { garri325 = "admin" }) + admin_teams = [github_team.team.name] } module "goss-testing" { @@ -53,11 +72,8 @@ module "goss-testing" { force_name = true create_codeowners = false enforce_prs = false - collaborators = { - naray007 = "write", - morga471 = "write", - # gomez385 = "write" - } + collaborators = local.collaborators + admin_teams = [github_team.team.name] } # terraform-repos @@ -74,6 +90,7 @@ module "automation-repos" { create_codeowners = false enforce_prs = false collaborators = local.collaborators + admin_teams = [github_team.team.name] } # terraform-github-repo @@ -90,6 +107,7 @@ module "terraform-github-repo" { enforce_prs = false create_codeowners = false collaborators = local.collaborators + admin_teams = [github_team.team.name] } @@ -109,6 +127,7 @@ module "elastic_beanstalk_java" { collaborators = local.collaborators template_repo = "aws-beanstalk" template_repo_org = "CSVD" + admin_teams = [github_team.team.name] } module "elastic_beanstalk_php" { @@ -127,6 +146,7 @@ module "elastic_beanstalk_php" { collaborators = local.collaborators template_repo = "aws-beanstalk" template_repo_org = "CSVD" + admin_teams = [github_team.team.name] } module "elastic_beanstalk_nodejs" { @@ -145,6 +165,7 @@ module "elastic_beanstalk_nodejs" { collaborators = local.collaborators template_repo = "aws-beanstalk" template_repo_org = "CSVD" + admin_teams = [github_team.team.name] } @@ -165,6 +186,7 @@ module "elastic_beanstalk_docker" { collaborators = local.collaborators template_repo = "aws-beanstalk" template_repo_org = "CSVD" + admin_teams = [github_team.team.name] } @@ -182,6 +204,7 @@ module "image_pipeline" { create_codeowners = false enforce_prs = false collaborators = local.collaborators + admin_teams = [github_team.team.name] } @@ -197,11 +220,9 @@ module "beanstalk-demo" { force_name = true create_codeowners = false enforce_prs = false - admin_teams = [ - "csvd_users" - ] is_template = true collaborators = local.collaborators + admin_teams = [github_team.team.name] } module "image-pipeline-ansible-roles" { @@ -216,11 +237,9 @@ module "image-pipeline-ansible-roles" { force_name = true create_codeowners = false enforce_prs = false - admin_teams = [ - "csvd_users" - ] is_template = true collaborators = local.collaborators + admin_teams = [github_team.team.name] } module "image-pipeline-playbook" { @@ -235,11 +254,9 @@ module "image-pipeline-playbook" { force_name = true create_codeowners = false enforce_prs = false - admin_teams = [ - "csvd_users" - ] is_template = true collaborators = local.collaborators + admin_teams = [github_team.team.name] } @@ -256,6 +273,7 @@ module "windows-ami-build" { force_name = true create_codeowners = false enforce_prs = false + admin_teams = [github_team.team.name] } resource "aws_codecommit_repository" "ansible" {