File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
modules/meshcloud-replicator-service-account Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,6 @@ resource "google_folder_iam_member" "replicator_service" {
72
72
member = " serviceAccount:${ google_service_account . replicator_service . email } "
73
73
}
74
74
75
-
76
75
/*
77
76
Billing Accounts are associated with an organization and can thus inherit organization level role assignments
78
77
see https://cloud.google.com/billing/docs/how-to/billing-access).
@@ -106,3 +105,12 @@ resource "google_service_account_iam_member" "replicator" {
106
105
role = " roles/iam.workloadIdentityUser"
107
106
member = " principal://iam.googleapis.com/${ var . workload_identity_federation . pool_id } /subject/${ var . workload_identity_federation . subject } "
108
107
}
108
+
109
+ # Cloud functions must be called with ID tokens but after impersonation we only have an access token and must explicitly create an ID token.
110
+ resource "google_service_account_iam_member" "replicator_id_token" {
111
+ for_each = var. workload_identity_federation == null ? {} : { 0 = " roles/iam.serviceAccountOpenIdTokenCreator" , 1 = " roles/iam.serviceAccountTokenCreator" }
112
+
113
+ service_account_id = google_service_account. replicator_service . id
114
+ role = each. value
115
+ member = " serviceAccount:${ google_service_account . replicator_service . email } "
116
+ }
You can’t perform that action at this time.
0 commit comments