My deployment of a Google Cloud Function is failing and this is all I'm getting in the logs:
Could not fetch secret "projects/xxx/secrets/xxx/versions/latest" for environment variable "xxx". Instance startup will now abort.
I've made sure that the Cloud Function's runtime account has the Secret Manager Secret Accessor
role.
I've tried enabling Secret Manager Secret Accessor
from the Cloud Build Settings page, but it still didn't work.
What role(s) should I be granting to which principal(s) to get this to work?