Refactor Naming Convention and Fix Deployment Errors#9
Merged
benjamin-747 merged 3 commits intogitmono-dev:mainfrom Feb 11, 2026
Merged
Conversation
…deployment errors - Standardize all resource naming to strictly use as a prefix (e.g., mega-vpc, mega-backend) - Move naming logic to locals in main.tf and set default resource name variables to empty strings - Fix Filestore network project mismatch by using project-qualified network ID references - Correct Monitoring alert policies by switching Gauge metrics from ALIGN_RATE to ALIGN_MEAN - Ensure Cloud Run services use correct container ports (8000 for backend, 3000 for UI) - Remove legacy name_prefix and lb_domain variables, unifying domain config under base_domain - Update terraform.tfvars.example to reflect the new naming convention and setup flow Signed-off-by: Hongze Gao <15101764808@163.com>
benjamin-747
requested changes
Feb 11, 2026
Comment on lines
-39
to
+45
| cloud_sql_instance_name = "mega-prod-db" | ||
| cloud_sql_instance_name = "mega-db" |
Collaborator
There was a problem hiding this comment.
应该不需要这个配置,直接用app_name 拼接 db 就行
| vpc_connector_cidr = "10.8.0.0/28" | ||
|
|
||
| # Redis (Memorystore) | ||
| redis_instance_name = "mega-prod-redis" |
Collaborator
There was a problem hiding this comment.
同理,用app_name 拼接 redis
| redis_memory_size_gb = 1 | ||
|
|
||
| # Filestore | ||
| filestore_instance_name = "mega-fs" |
- Implement "Convention over Configuration" by strictly enforcing resource naming prefixed with app_name in main.tf locals - Remove redundant resource name variables from variables.tf (VPC, DB, Redis, Filestore, Cloud Run service names, etc.) - Add Cloud Run service definitions for orion-server and campsite - Fix duplicate output definitions for app_cloud_run_url and ui_cloud_run_url - Fix invalid variable interpolation in variable descriptions within variables.tf - Correct Filestore network reference to use network_id, resolving project mismatch errors - Update terraform.tfvars.example to reflect the simplified configuration and new services Signed-off-by: Hongze Gao <15101764808@163.com>
benjamin-747
previously approved these changes
Feb 11, 2026
… naming Signed-off-by: Hongze Gao <15101764808@163.com>
benjamin-747
approved these changes
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR standardizes the GCP Terraform deployment naming convention and addresses several technical issues encountered during initial deployment. All resources are now dynamically named using the
${var.app_name}prefix to ensure consistency and fulfill project requirements. Additionally, it fixes critical errors in Filestore networking, Monitoring metrics, and Cloud Run port configurations.Key Changes
Naming Convention Refactor
main.tflocals. Resources now automatically prefix themselves with${var.app_name}(e.g.,mega-vpc,mega-backend-bs).name_prefixand redundantlb_domainvariables. Unified all domain-related configurations underbase_domain.terraform.tfvars.exampleto reflect the new<app_name>-*naming style and added instructions for synchronized configuration.Critical Bug Fixes
network project mismatcherror by using project-qualified network ID references for Filestore instances.google_monitoring_alert_policyby switching the aligner for Gauge metrics fromALIGN_RATEtoALIGN_MEAN(withREDUCE_MAX), preventing API validation failures.cloud_runmodule (Backend: 8000, UI: 3000) to resolve container startup timeouts.