Create a Pub/Sub Trigger for Cloud Function

Lab Details:

  1. This lab walks you through GCP Cloud Function and Cloud Pub-Sub Services.

  2. Make sure, you have completed the previous labs about GCP Cloud Function and Cloud Pub-Sub because here we will not go into detail about theory but we will connect these two services. If you have not completed the previous lab, we recommend you complete the previous lab first. 

  3. In this lab, we will create a Cloud Pub-Sub Topic and Cloud Functions.

  4. Then we will trigger the Cloud Pub-Sub from Cloud Functions.

  5. Finally, we will send a message from Cloud Pub-Sub and we will verify the message from Cloud Functions.

  6. Duration: 45 minutes

Lab Overview:

In this lab, we will create a Cloud function and trigger a Cloud Pub-Sub to display a message by using a python code. The trigger is the response to an event with the function call. Then, once we send the message in the Pub-sub we will be verifying from the Cloud Function logs.

Lab Tasks:

  1. Log into GCP Console

  2. Create a Cloud Pub-Sub Topic

  3. Create a Cloud Functions

  4. Trigger a Cloud Pub-Sub in the Cloud Functions

  5. Choose the runtime of the code and deploy the function

  6. Then send a message from the Cloud Pub-Sub

  7. View the message from Cloud Function Logs.



Join Whizlabs_Hands-On to Read the Rest of this Lab..and More!

Step 1 : Login to My-Account
Step 2 : Click on "Access Now" to view the course you have purchased
Step 3 : You will be taken to our Learn Management Solution (LMS) to access your Labs,Quiz and Video courses

Open Console