Permission ‘cloudfunctions.functions.get’ denied on resource ‘projects/[PROJECT_NAME]/locations/us-west1/functions/[FUNCTION_NAME]’

Question

This Content is from Stack Overflow. Question asked by jadi

I have setup a cloud build trigger using the directions here. I want have it setup so that any merge onto the main branch of my GitHub repo will start a Cloud Build Trigger and deploy the latest version to a Cloud Function. The current flow is GitHub Repo -> Cloud Source Repo -> Cloud Build -> Cloud Function.

I’m getting a permission denied on resource error. However I believe I have all the necessary permissions:

  • cloud build service account:
  • Cloud Functions Developer
  • Cloud Run Admin
  • Service Account User

Below is the cloudbuild.yaml I’m using:

steps:
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
  waitFor: ["-"]
  args:
  - gcloud
  - functions
  - deploy
  - [CLOUD_FUNCTION_NAME]
  - --region=us-west1
  - --source=.
  - --trigger-http
  - --runtime=RUNTIME
  dir: "[CURRENT_DIRECTORY_NAME]"
options:
  logging: CLOUD_LOGGING_ONLY

Any help would be great! I’ve spent a lot of time on this and not sure what else I’m missing



Solution

Check the Answers


For more tutorials visit Jtuto.com


This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 4.0.

people found this article helpful. What about you?