Deploying Google Cloud Functions (GCF)
Explore deploying Google Cloud Functions (GCF) using the Serverless Framework. Understand how to set up environment details, manage Node.js dependencies, deploy functions, and verify public accessibility. Learn how to configure IAM policies to control function access.
We'll cover the following...
Deploying functions
We’ll need to change a few entries in the serverless.yml file. Specifically, we’ll set the region, the project, and the location of the credentials file. As we’ve seen in previous sections, we’ll use sed magic to replace those values.
We’re almost ready to deploy our function, but before we do that, we need to install the dependencies. For that, we’ll need npm, which, more often than not, is installed through Node.js.
Note: If you don’t already have
npm, please execute that command.
apt update && \
apt install nodejs npm
Now we can install the dependencies.
The output, limited to the relevant information, is as follows.
The processes added 48 dependencies, and we can proceed to deploy the function. ...