Hi everyone, I just heard from fellow Google Customer Engineer that Cloud Function now available in my region Jakarta! It is exciting news as now we can utilize the Cloud Function within the Region itself!

Cloud Functions Locations | Cloud Functions Documentation

Image for post

So with that kind of news, I am interested to actually test it out for a small experience of serverless in this new availability in the Jakarta region. (If you have any further or more elaborated experience please do share it with me!)

Now the idea is just to test the basic functionality of the Cloud Function to just do the most famous code ever (Hello World — who did not know this code?) and tested it with the HTTP trigger (the most basic one) and also tested the Serverless Framework to deploy the code.

Shall we test?

[One] let’s just try to create the function from the UI and go to Cloud Function — ensure that the API is already enabled — and create a new function.

Image for post

Sorry for the mistake caused by the dual monitor, I am kinda lazy to redo the capture. I created the function in Asia-southeast2 (Jakarta!) and allow unauthorized invocation.

Image for post

just use the default hello world function using the Node.js 12 and deploy

So after the deployment, we can test it through several ways which the easiest is through the UI

Image for post

Run!

These are the triggers that actually Cloud Function is able to use, so it is more than just meet the eyes. Well, I will keep the other for some future stories.

Image for post

For other kinds of test, we can use the gcloud cli call

gcloud functions call <function name> --region <region> --data {<any data>}

Image for post

It runs!

Or we can just use the plain old curl

curl -X POST "https://<region>-<project name>.cloudfunctions.net/<function name>" -H "Content-type:application/json" --data '{}'

#gcp #serverless #cloud-functions #serverless-framework #jakarta-region #function

Cloud Function on GCP (Jakarta Region) & Serverless Framework
1.15 GEEK