Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Function and Service Account

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?
like image 663
searain Avatar asked Apr 12 '18 17:04

searain


1 Answers

  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
like image 67
A.Queue Avatar answered Nov 09 '22 02:11

A.Queue