File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -30,3 +30,28 @@ module "destination" {
3030 log_sink_writer_identity = module. log_export . writer_identity
3131 create_subscriber = true
3232}
33+
34+ resource "google_project_iam_custom_role" "consumer" {
35+ project = var. project_id
36+ role_id = " SplunkSink"
37+ title = " Splunk Sink"
38+ description = " Grant Splunk Addon for GCP permission to see the project and PubSub Subscription"
39+
40+ permissions = [
41+ " pubsub.subscriptions.list" ,
42+ " resourcemanager.projects.get" ,
43+ ]
44+ }
45+
46+ resource "google_project_iam_member" "consumer" {
47+ project = var. project_id
48+ role = google_project_iam_custom_role. consumer . id
49+ member = " serviceAccount:${ module . destination . pubsub_subscriber } "
50+ }
51+
52+ resource "google_pubsub_subscription_iam_member" "consumer" {
53+ project = var. project_id
54+ subscription = module. destination . pubsub_subscription
55+ role = " roles/pubsub.subscriber"
56+ member = " serviceAccount:${ module . destination . pubsub_subscriber } "
57+ }
You can’t perform that action at this time.
0 commit comments