The Simplest Way to Make Cloud Run and Google Cloud Deployment Manager Work Like They Should
Teams use cloud run and google cloud deployment manager to deploy container apps from templates. The template tool sets up the cloud resources, and the container platform runs the code. This pairing helps engineering teams build repeatable systems in Google Cloud. One tool defines the desired state of your services in text files. The other tool runs your stateless containers on managed servers. When they work together, teams avoid manual clicks in the web console. Every change goes through vers
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Teams use cloud run and google cloud deployment manager to deploy container apps from templates. The template tool sets up the cloud resources, and the container platform runs the code.
This pairing helps engineering teams build repeatable systems in Google Cloud. One tool defines the desired state of your services in text files. The other tool runs your stateless containers on managed servers. When they work together, teams avoid manual clicks in the web console. Every change goes through version control before it hits production.
How cloud run and google cloud deployment manager share roles and data
The deployment tool reads your template files and sends requests to Google Cloud APIs. It uses a built-in service account to create and update your container services. You must grant this account the right roles so it can manage containers. It also needs permission to attach a runtime identity to the new container service.
Data flows in one direction during a release. Your build pipeline sends the template to the deployment service. That service checks the current state of your project and updates the container settings. It passes environment variables, memory limits, and image paths to the container service. Once the container starts, it uses its own runtime service account to talk to databases. The deployment tool does not sit in the middle of live user traffic.
Common failure modes and how to scope roles
Many teams fail by using one shared service account for all tasks. The default deployment account often has broad editor permissions across the whole project. If a template has a mistake, it can wipe out unrelated databases or network rules. Developers might also attach the default compute account to the running container. This gives the live app far more access than it needs.
A second issue happens when teams mix manual edits with template updates. An engineer might change a container setting in the web console to fix a bug. The next time the deployment tool runs, it overwrites that manual fix. Teams also run into trouble when they store secret keys in plain template files. Anyone who can read the code repo can then read those live keys.
GCP Access Context Manager + Deployment Approval Gates: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
You can fix these issues by splitting your service accounts by job. Give the deployment tool only the roles needed to create and update container services. Create a separate, narrow service account for each container app you run. Grant that runtime account access only to the specific buckets or databases it needs. Store sensitive values in a secret manager instead of plain text files. Let the container fetch those secrets at startup using its own narrow identity.
Keeping network paths and audit logs clean
Network rules between your services need the same care as identity roles. By default, a new container service might accept traffic from the public internet. Your templates should set ingress rules so only internal load balancers can reach private apps. You should also route outbound container traffic through a private network connector. This keeps database traffic off public routes and inside your cloud network.
Good logging helps you track every change across both tools. Turn on admin activity logs to see when the deployment tool alters a service. Check data access logs to see which user triggered the deployment run. When you pair clear logs with small roles, you keep your cloud setup safe. Engineers can ship updates fast while security teams can verify every single action.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
How do I pass secrets to containers without putting them in templates?
Store the secret in Google Cloud Secret Manager first. Then pass only the secret reference path in your template so the container reads it at startup.
Why does my deployment fail with a permission error on the service account?
The deployment service account needs permission to act as the container runtime account. Grant the Service Account User role to the deployment account on that runtime identity.
What happens if someone changes a container setting outside the template tool?
The template tool tracks the state it last deployed. The next template run will overwrite manual console edits and restore the settings written in your template.
Related guides
In this post