The Serverless Framework needs access to account credentials for your Google Cloud account so that it can create and manage resources on your behalf.
You need a Billing Account with a credit card attached to use Google Cloud Functions. Here's how to create one:
If necessary, a more detailed guide on creating a Billing Account can be found here.
A Google Cloud Project is required to use Google Cloud Functions. Here's how to create one:
You need to enable the following APIs so that Serverless can create the corresponding resources.
Go to the API dashboard, select your project and enable the following APIs (if not already enabled):
You need to create credentials with appropriate roles Serverless can use to create resources in your Project.
IAM & admin
menu on left-sidebarService accounts
on left-sidebarCREATE SERVICE ACCOUNT
button on the topCreate
buttonDeployment Manager Editor
, Storage Admin
, Logging Admin
, Cloud Functions Developer
roles and click Continue
+CREATE KEY
button and select JSON
key type and click Create
buttonkeyfile
) file downloadedDone
buttonkeyfile
somewhere secure. We recommend making a folder in your root folder and putting it there. Like this, ~/.gcloud/keyfile.json
. You can change the file name from keyfile
to anything. Remember the path you saved it to.provider
config in serverless.yml
Open up your serverless.yml
file and update the provider
section with your Google Cloud Project id and
the path to your keyfile.json
file (this path needs to be absolute!). It should look something like this:
provider:
name: google
runtime: nodejs
project: my-serverless-project-1234
credentials: ~/.gcloud/keyfile.json