The following table describes Identity and Access Management (IAM) roles that are associated with Cloud Run, and lists the permissions that are contained in each role.
Roles can be granted to users on an entire project or on individual services. Read Managing access using IAM to learn more.
Roles only apply to Cloud Run services, they do not apply
to Cloud Run domain mappings. The
Project > Editor role
is needed to create or update domain mappings.
||Can create, update, and delete services.Can get and set IAM policies.Can view, apply and dismiss recommendations.Requires additional configuration in order to deploy services.||
||Can create, update, and delete services.Can get but not set IAM policies.Can view, apply and dismiss recommendations.||
||Can view services.Can get IAM policies.Can view recommendations.||
||Can invoke services.||
For a reference describing the IAM permissions contained in each IAM role, refer to Cloud Run IAM Permissions.
For developers that want to define their own roles containing bundles of permissions that they specify, IAM offers custom roles.
If the role contains permissions that let a developer deploy services, then you must perform the additional configuration below.
A user needs the following permissions to deploy new Cloud Run services or revisions:
run.services.updateon the project level are required.
run.services.getis not strictly required, but is recommended in order to read the status of the created service. Typically assigned through the
roles/run.adminrole. It can be changed in the project permissions admin page.
iam.serviceAccounts.actAsfor the Cloud Run runtime service account. By default, this is
PROJECT_NUMBERfirstname.lastname@example.org. The permission is typically assigned through the
To assign the IAM Service Account User role on the Cloud Run runtime service account:
Go to the Service accounts page of the Google Cloud console:
Click the email address of the Runtime Service Account (
Click the Permissions tab.
Click theGrant access button.
Enter the principal (e.g. user or group email) that matches the principal you're granting the Admin or Developer role to.
In the Select a role dropdown, select the Service Accounts > Service Account User role.
gcloud iam service-accounts add-iam-policy-binding command, replacing the highlighted variables with appropriate values:
gcloud iam service-accounts add-iam-policy-binding \ PROJECT_NUMBERemail@example.com \ --member="PRINCIPAL" \ --role="roles/iam.serviceAccountUser"
Replace PRINCIPAL with the principal you are adding the binding for,
using in the form
domain:domain. For example:
In addition to the developer needing these permissions, the Cloud Run service agent needs to be able to access the deployed container, which is the case by default.
Optional permissions for Cloud Run users
The following optional permissions can be considered when configuring accounts with minimal permission set:
monitoring.timeSeries.liston the project level. Typically assigned through the
roles/monitoring.viewerrole. It allows user to access metrics generated by their service. For more information, go to the Stackdriver documentation for Access Control.
logging.logEntries.liston the project level. Typically assigned through the
roles/logging.viewerrole. It allows user to access logs generated by their service. For more information, go to the Access Control guide in the Stackdriver Logging documentation.