serverless-google-cloudfunctions icon indicating copy to clipboard operation
serverless-google-cloudfunctions copied to clipboard

Service Account Configuration

Open songx23 opened this issue 6 years ago • 2 comments

When deploying GCP cloud functions, serverless framework always uses the default AppEngine service account. If I delete that default account and deploy, then I get this error message:

{  
   "ResourceType":"cloudfunctions.v1beta2.function",
   "ResourceErrorCode":"400",
   "ResourceErrorMessage":{  
      "code":400,
      "message":"Default service account '<project_id>@appspot.gserviceaccount.com' doesn't exist. Please recreate this account (for example by disabling and enabling the Cloud Functions API), or specify a different account.",
      "status":"FAILED_PRECONDITION",
      "details":[  

      ],
      "statusMessage":"Bad Request",
      "requestPath":"https://cloudfunctions.googleapis.com/v1beta2/projects/<project_id>/locations/asia-east2/functions",
      "httpMethod":"POST"
   }
}

Is there a way for developers to specify which service account to use, as the flag --service-account=xxx@xxx in gcloud command? If not, I think this should be a nice feature to add. Also, when will the resource type upgrade to v1?

songx23 avatar Apr 09 '19 04:04 songx23

same issue. Here is how to set service account using gcloud sdk.

gcloud functions deploy --service-account=xxx@xxx

Does serverless framework or this plugin support set --service-account? https://cloud.google.com/sdk/gcloud/reference/alpha/functions/deploy#--service-account

mrdulin avatar Jul 24 '19 04:07 mrdulin

This was already implemented here

functions:
  a-function:
    serviceAccountEmail: [email protected]

davedc avatar Apr 21 '22 05:04 davedc