Containerized notification system for whenever a new support case is opened within your project or organization. The Cloud Scheduler will run every 10 minutes by default, triggering the Cloud Run job. The Cloud Run job will check if there are any new support cases and trigger the alerting policy, which will send a notification to the user.
- This is not an officially supported Google product.
- Proper testing should be done before running this tool in production.
- Standard, Enhanced, or Premium support must be enabled for case creation and Support API usage
- This solution assumes that the user has been assigned the appropriate IAM roles
This sample code is made available under Apache 2 license. See the LICENSE file for more details.
- Cloud Run Invocation, usually free
- Cloud Scheduler Jobs for running the script in intervals.
- Customer Care pricing for Standard, Enhanced, or Premium Support
- Cloud Logging and monitoring for alerts when a new case is opened.
- Cloud Storage for retrieval and writing to a textfile stored in storage.
- Clone the git repo using
git clone REPO
- In the Configuration.yaml file:
- Replace the "example-project-id" with your project ID
- Replace the "example-org-id" with your organization ID
- If you would like to receive notifications from new support cases at the project level, replace the False with True. Otherwise, if you would like to receive notifications from new support cases at the organization level, leave it as False.
- Allow execution permissions with
chmod +x setup.sh build.sh deploy.sh ListProjects.sh
- Export the project ID
export PROJECT_ID=$(gcloud config get-value project)
- Creating a notification channel (skip this step if you already have a notification channel you would like to use):
- Update the "[email protected]" with your email in
emailNotification.json
file - Run
gcloud beta monitoring channels create --channel-content-from-file="emailNotification.json"
- Update the "[email protected]" with your email in
- Update the alert policy:
- List the alerts with
gcloud alpha monitoring channels list
- Replace the "notificationsChannel" value (line 26) with the name of the notification channel you would like to use
- List the alerts with
- (Optional) Change the frequency that the script is run. The script runs every 10 minutes by default
- In deploy.sh change the FREQUENCY variable (line 18)
- Setup the service accounts and permissions by running
./setup.sh [ORGANIZATION_ID]
(Replace with your organization ID) - Containerize the application by running
./build.sh
- Deploy and create the alerting policy by running
./deploy.sh
You're done! You will receive notifications whenever a new support case is opened.