Skip to content

Commit

Permalink
Simplify service_account_email expression
Browse files Browse the repository at this point in the history
  • Loading branch information
wiktorn committed Nov 16, 2022
1 parent 4947ac5 commit 0121806
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions modules/cloud-function/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,8 @@ locals {
? google_cloudfunctions2_function.function[0]
: google_cloudfunctions_function.function[0]
)
prefix = var.prefix == null ? "" : "${var.prefix}-"
service_account_email = (
var.service_account_create
? (
length(google_service_account.service_account) > 0
? google_service_account.service_account[0].email
: null
)
: var.service_account
)
prefix = var.prefix == null ? "" : "${var.prefix}-"
service_account_email = var.service_account_create ? google_service_account.service_account[0].email : var.service_account
trigger_service_account_email = (
coalesce(try(var.trigger_config.v2.service_account_create, false), false)
? google_service_account.trigger_service_account[0].email
Expand Down

0 comments on commit 0121806

Please sign in to comment.