Skip to content

Conversation

@msantoroks
Copy link
Collaborator

  • Manage Cloud SQL instances for dev and prod (preview uses dev via peering)
  • Auto-generate passwords and store in Secret Manager
  • Configure minimal resources for testing
  • Implement bidirectional VPC peering between preview and dev
  • Organize VPC peering configuration in vpc.tf

- Manage Cloud SQL instances for dev and prod (preview uses dev via peering)
- Auto-generate passwords and store in Secret Manager
- Configure minimal resources for testing
- Implement bidirectional VPC peering between preview and dev
- Organize VPC peering configuration in vpc.tf
- Dev: db-custom-2-3840 (2 vCPUs, 3.75GB RAM, 50GB storage)
- Prod: db-custom-4-7680 (4 vCPUs, 7.5GB RAM, 100GB storage)
- Enable backups, PITR, and deletion protection for prod
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

Preview Deployment Complete

Infrastructure deployed to preview-pr-126 environment.

Access URLs

Note: Custom domain not configured for preview environments. Use Cloud Run URL to access the application.

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

Preview Deployment Complete

Infrastructure deployed to preview-pr-126 environment.

Access URLs

Note: Custom domain not configured for preview environments. Use Cloud Run URL to access the application.

@msantoroks msantoroks marked this pull request as ready for review December 8, 2025 13:53
Comment on lines +332 to +348
# Reverse peering from dev to preview environments
# This completes the bidirectional peering connection
resource "google_compute_network_peering" "dev_to_preview" {
for_each = var.environment == "dev" ? var.preview_vpc_names : toset([])
name = "dev-to-preview-peering-${replace(each.value, "labs-asp-vpc-", "")}"
network = google_compute_network.main.id
peer_network = data.google_compute_network.preview_vpcs[each.value].id

import_custom_routes = true
export_custom_routes = true

depends_on = [
google_compute_network.main,
google_service_networking_connection.private_vpc_connection
]
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not clear why you are using VPC peering at all. Can't the Cloud SQL instance authorize a specific CIDR ranges. Since preview uses 10.1.0.0/16, why not just add that to the Cloud SQL's authorized networks?

With the current setup I think we would have to manage the dev->preview VPC connection as well right?

I might be a bit ignorant here, anything you can share about why bidirectional VPC peering is a good idea might help me understand better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants