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 & adminmenu on left-sidebar
Service accountson left-sidebar
CREATE SERVICE ACCOUNTbutton on the top
Deployment Manager Editor
Cloud Functions Developerroles and click
+CREATE KEYbutton and select
JSONkey type and click
keyfile) file downloaded
keyfilesomewhere 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
keyfileto anything. Remember the path you saved it to.
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