4
votes

I want to access Youtube Content Owner API with Google Cloud Functions. For that the service account used by GCF has to have access to that API.

When I create a Google Cloud Function, it's automatically assigned a service account. In this case the "App Engine default service account". I have a few questions about this.

  1. Does Google Cloud Function always use "App Engine default service account" as the service account?
  2. While editing the cloud function, I cannot see any way to change a service account of a Google Cloud Function. Once it is set up for a Cloud Function, the service account can not be changed, right?
  3. If the default service account is given access to Youtube Content Owner API then Google Cloud Functions will have it, too?
1

1 Answers

2
votes
  1. Yes, Cloud Functions use the App Engine default service account, as explained here.

  2. Indeed there is no such option yet. There is a public Feature Request opened for this if you are interested.

  3. True, Cloud Function will inherit all the access right from the default service account.

Alternatively, to use credentials with Cloud Functions other then the App Engine Default service account you could:

  • use an authentication token
  • upload a non-default service account directly with your Cloud Function and use it from with in it as described here