Google Cloud Functions is a serverless execution environment for building and connecting cloud
services.Cloud functions can be created from code deployed in storage bucket. Below are steps for
creating cloud functions
from Cloud Storage Buckets.
Create a file with name "main.py" with below code and zip the main.py file.
login to Google Cloud Console and navigate to "Storage" in "STORAGE" section.
create a bucket
upload zipped file to newly created bucket.
navigate to Cloud Functions in "COMPUTE" section
Click on "CREATE FUNCTION".
Provide Function details as listed below.
Memory allocated: 256 MB
Note down the URL
Authentication: Allow unauthenticated invocations
Source code: ZIP from Cloud Storage
Runtime: Python 3.7
Cloud Storage location: Navigate to uploaded zipped file in bucket
Provide name of Function to execute.
Click on bucket-cloud-function
In trigger section click on the URL
In the browser you should be able to see cloud function response