Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Creation of Cloud Function

Hi Team,
Thanks in Advance.

How to create a Cloud Function that periodically checks the SSL certificate list API to verify the expiration dates of your certificates, and which notifies you when the expiration date is within your defined threshold in GCP

0 3 286
3 REPLIES 3

Is your question related to AppSheet? Perhaps you meant to post in the Google Cloud Community

Hi @Aravind_07,

Welcome to Google Cloud Community!

To create a Cloud Function that periodically checks the SSL certificate list API to verify the expiration dates of your certificates, and which notifies you when the expiration date is within your defined threshold in GCP, you can follow these steps:

  1. Create a new Cloud Function in the GCP Console, or use the gcloud command-line tool to create a new function.
  2. In the Cloud Function's code, include the necessary imports and dependencies for making API calls to the SSL certificate list API and for sending notifications.
  3. In the function's code, implement logic that makes an API call to the SSL certificate list API, parses the response to extract the expiration dates of the certificates, and compares them to a threshold value to determine whether they are expiring soon.
  4. Implement logic for sending notifications (e.g email, SMS) to specified recipient when the SSL certificate is within defined threshold.
  5. Deploy the Cloud Function, and configure its trigger to run periodically (e.g. every day)
  6. Test the function to ensure it is working as expected.

You can use the Language of your choice to develop the function, which is supported by GCP, eg. Node.js, Python, Go.

You might also want to consider using a third-party library for parsing the SSL certificate list API's response, such as the "ssl-cert-check" package for Node.js or the "pyopenssl" package for Python, which can help simplify the process of extracting the expiration dates.

Thank you

Thank you christianpaula.