Cloud Functions IAM Roles
Predefined roles
The following table describes Identity and Access Management (IAM) roles that are associated with Cloud Functions, and lists the permissions that are contained in each role.
Roles can be granted to users on an entire project or on individual functions. Read Managing Access via IAM to learn more.
Cloud Functions roles
Role | Permissions |
---|---|
Cloud Functions Admin
Full access to functions, operations and locations. |
|
Cloud Functions Developer
Read and write access to all functions-related resources. |
|
Cloud Functions Invoker
Ability to invoke HTTP functions with restricted access. |
|
Cloud Functions Viewer
Read-only access to functions and locations. |
|
Custom roles
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 functions, then you must perform the additional configuration in the next section.
Additional configuration for deployment
In order to assign a user the Cloud Functions Admin
(roles/cloudfunctions.admin
) or Cloud Functions Developer role
(roles/cloudfunctions.developer
) or a custom role that can deploy functions,
you must also assign the user the Service Account User IAM role
(roles/iam.serviceAccountUser
) on the Cloud Functions
runtime service account.
Console
Go to the Google Cloud console:
Select the Runtime Service Account (
PROJECT_ID@appspot.gserviceaccount.com
) from the table.Click Manage Access.
Click Add member.
Enter the member (for example, user or group email) that you're granting the Admin or Developer role to.
Grant the
roles/iam.serviceAccountUser
role under Service Accounts > Service Account user in the Select a role dropdown.Click Save.
gcloud
gcloud iam service-accounts add-iam-policy-binding \ PROJECT_ID@appspot.gserviceaccount.com \ --member MEMBER \ --role roles/iam.serviceAccountUser