Skip to content

Commit

Permalink
Added change for default service account deprivilege setting
Browse files Browse the repository at this point in the history
  • Loading branch information
ddaluka committed Sep 29, 2022
1 parent 46f8cb1 commit 5a245c4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/project/service-accounts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,11 @@ resource "google_kms_crypto_key_iam_member" "service_identity_cmek" {
data.google_storage_project_service_account.gcs_sa,
]
}

resource "google_project_default_service_accounts" "default_service_accounts" {
count = upper(var.default_service_account) == "KEEP" ? 0 : 1
action = upper(var.default_service_account)
project = local.project.project_id
restore_policy = "REVERT_AND_IGNORE_FAILURE"
depends_on = [google_project_service.project_services]
}
6 changes: 6 additions & 0 deletions modules/project/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ variable "descriptive_name" {
default = null
}

variable "default_service_account" {
description = "Project default service account setting: can be one of `delete`, `deprivilege`, `disable`, or `keep`."
default = "keep"
type = string
}

variable "group_iam" {
description = "Authoritative IAM binding for organization groups, in {GROUP_EMAIL => [ROLES]} format. Group emails need to be static. Can be used in combination with the `iam` variable."
type = map(list(string))
Expand Down

0 comments on commit 5a245c4

Please sign in to comment.