diff --git a/.github/workflows/terraform_apply.yaml b/.github/workflows/terraform_apply.yaml index 25e1a03..e42431f 100644 --- a/.github/workflows/terraform_apply.yaml +++ b/.github/workflows/terraform_apply.yaml @@ -15,7 +15,9 @@ jobs: # The type of runner that the job will run on runs-on: [ "229685449397" ] env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" + GITHUB_OWNER: CSVD + GITHUB_BASE_URL: https://github.e.it.census.gov TF_WORKSPACE: ${{ vars.terraform_workspace }} # Steps represent a sequence of tasks that will be executed as part of the job @@ -51,10 +53,10 @@ jobs: - name: Terraform Plan id: plan - run: /opt/tfenv/bin/terraform plan -var-file=varfies/${{ vars.terraform_workspace }}.tfvars + run: /opt/tfenv/bin/terraform plan -var-file=varfiles/${{ vars.terraform_workspace }}.tfvars # - name: Terraform Apply # id: plan -# run: /opt/tfenv/bin/terraform apply -auto-approve +# run: /opt/tfenv/bin/terraform apply -auto-approve -var-file=varfiles/${{ vars.terraform_workspace }}.tfvars # continue-on-error: true diff --git a/data.tf b/data.tf index 2502393..6692404 100644 --- a/data.tf +++ b/data.tf @@ -1 +1,3 @@ data "aws_region" "current" {} + +data "github_organization_teams" "teams" {} diff --git a/github-runners.tf b/github-runners.tf index 74bce79..5c3032d 100644 --- a/github-runners.tf +++ b/github-runners.tf @@ -13,6 +13,7 @@ module "template_ecs_github_runners" { enforce_prs = false collaborators = local.collaborators pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } module "csvd_ecs_github_runners" { @@ -29,4 +30,5 @@ module "csvd_ecs_github_runners" { enforce_prs = false collaborators = local.collaborators pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } diff --git a/image-pipeline.tf b/image-pipeline.tf index 529720c..a60ba30 100644 --- a/image-pipeline.tf +++ b/image-pipeline.tf @@ -27,6 +27,7 @@ module "image_pipeline_repos" { enforce_prs = true collaborators = local.collaborators pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams managed_extra_files = [ { path = ".github/workflows/s3_upload.yaml" @@ -49,6 +50,7 @@ module "asset_releases" { github_repo_description = "Terraform Workspace for publishing image-pipeline-assets" repo_org = "CSVD" name = "image-pipeline-asset-releases" + github_org_teams = local.github_organization_teams github_repo_topics = [ "terraform" ] @@ -66,6 +68,7 @@ module "aws_image_pipeline" { github_repo_description = "Terraform Workspace for creating and managing AWS Image Pipelines" repo_org = "CSVD" name = "aws-image-pipeline" + github_org_teams = local.github_organization_teams github_repo_topics = [ "terraform" ] @@ -109,6 +112,7 @@ module "terraform_aws_image_pipeline" { github_repo_description = "Terraform Module that creates codepipeline and codebuild jobs and other resources for building and deploying images" repo_org = "CSVD" name = "terraform-aws-image-pipeline" + github_org_teams = local.github_organization_teams github_repo_topics = [ "terraform" ] diff --git a/main.tf b/main.tf index 20d73d9..97bb65a 100644 --- a/main.tf +++ b/main.tf @@ -8,6 +8,7 @@ locals { "arnol377", "gomez385" ] + github_organization_teams = data.github_organization_teams.teams } @@ -26,6 +27,7 @@ module "elastic_beanstalk" { enforce_prs = false collaborators = local.collaborators pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } @@ -45,6 +47,7 @@ module "automation-repos" { enforce_prs = false collaborators = local.collaborators pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } # terraform-repos @@ -62,6 +65,7 @@ module "csvd-org-management" { enforce_prs = false collaborators = local.collaborators pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } module "external-actions" { @@ -78,6 +82,7 @@ module "external-actions" { enforce_prs = false collaborators = local.collaborators pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } module "github-runner-images" { @@ -94,6 +99,7 @@ module "github-runner-images" { enforce_prs = false collaborators = local.collaborators pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } @@ -114,6 +120,7 @@ module "centralized-actions" { collaborators = local.collaborators pull_request_bypassers = local.pull_request_bypassers github_is_private = false + github_org_teams = local.github_organization_teams } # terraform-github-repo @@ -131,6 +138,7 @@ module "terraform-github-repo" { create_codeowners = false collaborators = local.collaborators pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } @@ -151,6 +159,7 @@ module "elastic_beanstalk_java" { template_repo = "aws-beanstalk" template_repo_org = "CSVD" pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } module "elastic_beanstalk_php" { @@ -170,6 +179,7 @@ module "elastic_beanstalk_php" { template_repo = "aws-beanstalk" template_repo_org = "CSVD" pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } module "elastic_beanstalk_nodejs" { @@ -189,6 +199,7 @@ module "elastic_beanstalk_nodejs" { template_repo = "aws-beanstalk" template_repo_org = "CSVD" pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } @@ -207,6 +218,7 @@ module "test-statefile" { enforce_prs = false collaborators = local.collaborators pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } @@ -227,6 +239,7 @@ module "elastic_beanstalk_docker" { template_repo = "aws-beanstalk" template_repo_org = "CSVD" pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } module "beanstalk-demo" { @@ -244,6 +257,7 @@ module "beanstalk-demo" { is_template = true collaborators = local.collaborators pull_request_bypassers = local.pull_request_bypassers + github_org_teams = local.github_organization_teams } module "setup_terraform" { @@ -259,6 +273,7 @@ module "setup_terraform" { create_codeowners = false enforce_prs = false collaborators = local.collaborators + github_org_teams = local.github_organization_teams } module "setup_node" { @@ -274,6 +289,7 @@ module "setup_node" { create_codeowners = false enforce_prs = false collaborators = local.collaborators + github_org_teams = local.github_organization_teams } # ghe-runner @@ -290,6 +306,7 @@ module "ghe_runners" { create_codeowners = false enforce_prs = false collaborators = local.collaborators + github_org_teams = local.github_organization_teams } module "vpc_services" { diff --git a/morpheus.tf b/morpheus.tf index b8abed3..170f470 100644 --- a/morpheus.tf +++ b/morpheus.tf @@ -10,6 +10,7 @@ module "morpheus_repos" { source = "HappyPathway/repo/github" #github_codeowners_team = "CSVD" github_repo_description = "Repo for morpheus cloud" + github_org_teams = local.github_organization_teams repo_org = "CSVD" name = each.value github_repo_topics = [ diff --git a/sandbox.tf b/sandbox.tf index 4919232..e80f158 100644 --- a/sandbox.tf +++ b/sandbox.tf @@ -19,6 +19,7 @@ module "sandbox" { create_codeowners = false enforce_prs = false collaborators = { "arnol377" : "admin" } + github_org_teams = local.github_organization_teams managed_extra_files = [ { path = ".github/workflows/terraform-plan.yaml"