Skip to content

Commit

Permalink
post-fix cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ideasculptor committed Nov 15, 2019
1 parent 5d6bca8 commit 6ceb0a9
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ locals {
local.base_role_id,
random_id.random_role_id_suffix.hex,
) : local.base_role_id
bastion_roles = toset(compact(concat(
var.service_account_roles,
var.service_account_roles_supplemental,
)))
bastion_roles_count = var.service_account_roles_count + var.service_account_roles_supplemental_count
}

resource "google_service_account" "bastion_host" {
Expand Down Expand Up @@ -108,12 +103,13 @@ resource "google_service_account_iam_binding" "bastion_sa_user" {
}

resource "google_project_iam_member" "bastion_sa_bindings" {
# count = local.bastion_roles_count
for_each = local.bastion_roles
for_each = toset(compact(concat(
var.service_account_roles,
var.service_account_roles_supplemental,
)))

project = var.project
role = each.value
# role = element(local.bastion_roles, count.index)
role = each.key
member = "serviceAccount:${google_service_account.bastion_host.email}"
}

Expand Down

0 comments on commit 6ceb0a9

Please sign in to comment.