Skip to content

Commit 97a3f30

Browse files
committed
fix: create service account if service account email is not provided
1 parent 37139d2 commit 97a3f30

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/instance_template/main.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ locals {
7373
: null
7474
)
7575
)
76-
create_service_account = var.create_service_account ? var.service_account == null : false
76+
create_service_account = var.create_service_account && (
77+
var.service_account == null ||
78+
var.service_account.email == null ||
79+
var.service_account.email == ""
80+
)
7781

7882
service_account_prefix = substr("${var.name_prefix}-${var.region}", 0, 27)
7983
service_account_output = local.create_service_account ? {

0 commit comments

Comments
 (0)