This repository contains Google Cloud Platform (GCP) scripts to automatically label and manage Cloud Run functions, jobs, and services across different environments.
cloud_run_function/ - Scripts for labeling Cloud Run Functions
cloud_run_job/ - Scripts for labeling Cloud Run Jobs
cloud_run_services/ - Scripts for labeling Cloud Run Services
Each directory contains scripts organized by environment:
dev/- Development environmentpilot/- Pilot/Testing environmentuat/- User Acceptance Testing environmentprod/- Production environment
These scripts help manage and apply consistent labels to your GCP Cloud Run resources. Proper labeling is essential for:
- Resource organization and cost allocation
- Automated resource management
- Monitoring and logging
- Access control and security policies
- Google Cloud SDK installed and configured: https://cloud.google.com/sdk/docs/install
gcloudCLI properly authenticated with appropriate permissions- Access to Google Cloud Project with Cloud Run management capabilities
- Navigate to the desired directory (e.g.,
cloud_run_job/) - Review and customize the environment variable in the script
- Execute the appropriate script for your environment
Each directory contains a readme.md file with specific instructions for that resource type.
| Environment | Purpose |
|---|---|
| dev | Development and testing |
| pilot | Pilot deployment and testing |
| uat | User Acceptance Testing |
| prod | Production environment |
Scripts to update labels for Cloud Run Functions with the function name as the label value.
Scripts to update labels for Cloud Run Jobs with the job name as the label value.
Scripts to update labels for Cloud Run Services with the service name as the label value.
- All scripts target the
asia-south1region by default - Ensure you have proper IAM permissions before running scripts
- Test scripts in non-production environments first
- Review generated
.txtfiles before applying labels to confirm correct resources are selected
For issues or questions, please review the individual readme.md files in each directory.
๐จโ๐ป Author Manish Pandey Cloud | DevOps | Platform Engineer
๐ GitHub: https://github.com/mpandey95 ๐ผ LinkedIn: https://www.linkedin.com/in/manish-pandey95
โญ Contributing Contributions are welcome! Feel free to open issues or submit PRs to improve the script.
๐ License MIT License โ free to use, modify, and distribute.