Your review queue is stalled again. Gerrit is waiting for database writes, and Cloud SQL is throwing permission errors that make no sense until you open the audit logs. Every engineer has seen it, shrugged, and opened yet another IAM tab.
Cloud SQL Gerrit is one of those integrations that looks obvious on paper—Gerrit manages code reviews, Cloud SQL handles the relational data—but connecting them with real identity-aware access takes discipline. Once configured correctly, you get version-controlled reviews backed by reliable, scalable SQL storage that never locks up under load. And more importantly, you stop patching permissions at 2 a.m.
In practice, Cloud SQL runs your backing store for Gerrit’s metadata: changes, approvals, accounts, and group settings. When Gerrit talks to that database, it needs predictable credentials and network paths signed with service account identities, not cached passwords. The integration works best when Cloud SQL uses private IP access and Gerrit connects with IAM database authentication. That way, review operations are tied to verified identities rather than static secrets that could drift out of sync.
How do I connect Cloud SQL and Gerrit securely?
Use Cloud SQL IAM authentication and restrict the Gerrit instance’s service account with least privilege roles. Then map Gerrit’s database config to the Cloud SQL connection using the generated SSL certificates. Rotate keys automatically with your CI system, and store connection secrets using a provider like AWS Secrets Manager or HashiCorp Vault. This setup keeps access logged and revocable, solving most of the hidden “permission denied” alerts you’ll see otherwise.
Once traffic flows cleanly, you can enhance access control with OIDC providers such as Okta or Google Identity. Cloud SQL recognizes those sessions, Gerrit respects them, and your team avoids juggling shared credentials. For compliance, tie this into SOC 2-aligned audit pipelines so every schema change and code approval has a traceable signature.