There is an existing Deployment-1 that creates a PubSub Topic.
resources:
- name: customer-updates-topic
type: pubsub.v1.topic
properties:
topic: customer-updates
accessControl:
gcpIamPolicy:
bindings:
- members:
- serviceAccount:955977181320@cloudbuild.gserviceaccount.com
role: roles/pubsub.publisher
- members:
- serviceAccount:955977181320@cloudbuild.gserviceaccount.com
role: roles/pubsub.viewer
I need to create my own Deployment-2 like below, where I want to create a Service Account and grant it Publisher role on the topic created in the above deployment.
resources:
- name: customer-updates-svc
type: iam.v1.serviceAccount
properties:
accountId: customer-updates-svc
- name: pubsub-topic
type: pubsub.v1.topic
properties:
topic: customer-updates
accessControl:
gcpIamPolicy:
bindings:
- members:
- serviceAccount:$(ref.customer-updates-svc.email)
role: roles/pubsub.publisher
metadata:
dependsOn:
- customer-updates-svc
My Deployment-2 works fine, but it removes the gcpIamPolicy.bindings set by the Deployment-1.
Is there a way to add/append new gcpIamPolicy.bindings to an existing topic?
Thanks, TM