Skip to content

Commit a0420cf

Browse files
enhance(modular): add unique naming for ingestion_topic name (#41)
* enhance(modular): add unique naming for ingestion_topic name * enhance(modular): fix iam member vs iam binding authoritative issue
1 parent d8e8da8 commit a0420cf

File tree

1 file changed

+4
-7
lines changed
  • modules/integrations/pub-sub

1 file changed

+4
-7
lines changed

modules/integrations/pub-sub/main.tf

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ resource "google_project_iam_audit_config" "audit_config" {
7373
# Ingestion Topic
7474
#-----------------------------------------------------------------------------------------
7575
resource "google_pubsub_topic" "ingestion_topic" {
76-
name = "ingestion_topic"
76+
name = "ingestion_topic_${local.suffix}"
7777
labels = var.labels
7878
project = var.project_id
7979
message_retention_duration = var.message_retention_duration
8080
}
8181

8282
resource "google_pubsub_topic" "deadletter_topic" {
83-
name = "dl-${google_pubsub_topic.ingestion_topic.name}"
83+
name = "dl_${google_pubsub_topic.ingestion_topic.name}"
8484
project = var.project_id
8585
message_retention_duration = var.message_retention_duration
8686
}
@@ -128,13 +128,10 @@ resource "google_service_account" "push_auth" {
128128
project = var.project_id
129129
}
130130

131-
resource "google_service_account_iam_binding" "push_auth_binding" {
131+
resource "google_service_account_iam_member" "push_auth_binding" {
132132
service_account_id = google_service_account.push_auth.name
133133
role = "roles/iam.workloadIdentityUser"
134-
135-
members = [
136-
"serviceAccount:${google_service_account.push_auth.email}",
137-
]
134+
member = "serviceAccount:${google_service_account.push_auth.email}"
138135
}
139136

140137
resource "google_pubsub_subscription" "ingestion_topic_push_subscription" {

0 commit comments

Comments
 (0)