Skip to content

Commit 83a8be2

Browse files
authored
fix: allow ACM module to work w/o metrics sa (#1634)
1 parent ea3e374 commit 83a8be2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

modules/acm/creds.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ resource "google_service_account" "acm_metrics_writer_sa" {
107107
}
108108

109109
resource "google_project_iam_member" "acm_metrics_writer_sa_role" {
110+
count = var.create_metrics_gcp_sa ? 1 : 0
110111
project = var.project_id
111112
role = "roles/monitoring.metricWriter"
112113
member = "serviceAccount:${google_service_account.acm_metrics_writer_sa[0].email}"

modules/acm/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ output "wait" {
3434

3535
output "acm_metrics_writer_sa" {
3636
description = "The ACM metrics writer Service Account"
37-
value = google_service_account.acm_metrics_writer_sa[0].email
37+
value = var.create_metrics_gcp_sa ? google_service_account.acm_metrics_writer_sa[0].email : null
3838
}

0 commit comments

Comments
 (0)