I've been trying to create a public cloud run invoker policy and bind that to my cb_app cloud run service so that it can be exposed. I've created a custom service and assigned it cloud admin role. But getting this error
Error: Error creating Service: googleapi: Error 403: Permission 'iam.serviceaccounts.actAs' denied on service account [email protected] (or it may not exist).
Here are the configs
resource "google_cloud_run_service_iam_member" "domain" {
service = google_cloud_run_service.cb_app.name
location = google_cloud_run_service.cb_app.location
role = "roles/run.admin"
member = "serviceAccount:${var.service_account}"
}
#create service account to run service
resource "google_service_account" "cb_app" {
account_id = "app-worker"
display_name = "app worker"
}
And in app service, I have this
spec {
# Use locked down Service Account
service_account_name = google_service_account.cb_app.email
Any ideas on how to solve this?