Skip to content

Commit

Permalink
fix: source repos keys in sa_roles map (#895)
Browse files Browse the repository at this point in the history
Fix source repos to allow user to create as many applications workspaces as user needs and just provide the roles (sa_roles) to user applications.
  • Loading branch information
felipecrescencio-cit authored Dec 7, 2022
1 parent 1f25750 commit 8bd7d14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion 4-projects/modules/single_project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
locals {
env_code = element(split("", var.environment), 0)
shared_vpc_mode = var.enable_hub_and_spoke ? "-spoke" : ""
source_repos = keys(var.app_infra_pipeline_service_accounts)
source_repos = setintersection(
toset(keys(var.app_infra_pipeline_service_accounts)),
toset(keys(var.sa_roles))
)
pipeline_roles = var.enable_cloudbuild_deploy ? flatten([
for repo in local.source_repos : [
for role in var.sa_roles[repo] :
Expand Down

0 comments on commit 8bd7d14

Please sign in to comment.