Skip to content

Commit

Permalink
Merge branch 'service_accounts'
Browse files Browse the repository at this point in the history
  • Loading branch information
arnol377 committed Sep 5, 2024
2 parents af00e3a + 56a76a7 commit d9dac24
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/terraform_apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
env:
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
AWS_ACCESS_KEY_ID: "${{ vars.AWS_ACCESS_KEY_ID }}"
AWS_SESSION_TOKEN: "${{ secrets.AWS_SESSION_TOKEN }}"
AWS_DEFAULT_REGION: "${{ vars.AWS_DEFAULT_REGION }}"
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"


Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/terraform_plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
env:
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
AWS_ACCESS_KEY_ID: "${{ vars.AWS_ACCESS_KEY_ID }}"
AWS_SESSION_TOKEN: "${{ secrets.AWS_SESSION_TOKEN }}"
AWS_DEFAULT_REGION: "${{ vars.AWS_SESSION_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"


Expand Down
15 changes: 6 additions & 9 deletions image-pipeline.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ locals {
]
}

locals {
s3_upload = "${path.module}/workflows/s3_upload.yaml.tpl"
}

module "image_pipeline_repos" {
for_each = toset(local.pipeline_repos)
Expand All @@ -22,13 +25,13 @@ module "image_pipeline_repos" {
force_name = true
create_codeowners = false
enforce_prs = true
collaborators = merge(local.collaborators, { garri325 = "admin" })
collaborators = local.collaborators
pull_request_bypassers = local.pull_request_bypassers
managed_extra_files = [
{
path = ".github/workflows/s3_upload.yaml"
content = templatefile(
"${path.module}/workflows/s3_upload.yaml.tpl",
lookup(var.image_pipeline_workflows, each.value, local.s3_upload),
{
repo_name = each.value,
bucket_name = "image-pipeline-assets"
Expand Down Expand Up @@ -71,12 +74,6 @@ module "aws_image_pipeline" {
enforce_prs = true
collaborators = local.collaborators
pull_request_bypassers = local.pull_request_bypassers
vars = [
{
name = "terraform_version"
value = "1.9.1"
}
]
managed_extra_files = [
{
path = ".github/workflows/terraform-plan.yaml"
Expand Down Expand Up @@ -124,7 +121,7 @@ module "terraform_aws_image_pipeline" {
{
name = "terraform_version"
value = "1.9.1"
}
},
]
managed_extra_files = [
{
Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module "automation-repos" {
collaborators = local.collaborators
pull_request_bypassers = local.pull_request_bypassers
}

# centralized-actions
module "centralized-actions" {
source = "HappyPathway/repo/github"
Expand All @@ -65,7 +65,7 @@ module "centralized-actions" {
pull_request_bypassers = local.pull_request_bypassers
github_is_private = false
}

# terraform-github-repo
module "terraform-github-repo" {
source = "git@github.e.it.census.gov:CSVD/terraform-github-repo"
Expand Down
15 changes: 1 addition & 14 deletions sandbox.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module "sandbox" {
github_is_private = false
create_codeowners = false
enforce_prs = false
collaborators = {"arnol377": "admin"}
collaborators = { "arnol377" : "admin" }
managed_extra_files = [
{
path = ".github/workflows/terraform-plan.yaml"
Expand All @@ -45,17 +45,4 @@ module "sandbox" {
)
}
]
secrets = [
for secret in [for secret in local.secrets : secret if secret != "AWS_ACCESS_KEY_ID"] :
{
name = replace(secret, "GITHUB", "GH")
value = lookup(module.env_var, secret).value
}
]
vars = [
{
name = "AWS_ACCESS_KEY_ID"
value = lookup(module.env_var, "AWS_ACCESS_KEY_ID").value
}
]
}
3 changes: 3 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
variable "image_pipeline_workflows" {
type = map(string)
}

0 comments on commit d9dac24

Please sign in to comment.