Cloud Tasks uses Identity and Access Management (IAM) for access control. For an introduction to IAM and its features, see the IAM overview. To learn how to grant and revoke access, see Manage access to projects, folders, and organizations.
You can configure access control at the project level and at the queue level. For example, you might grant a user permission to create and add tasks to a queue, but not delete the queue. Or you might grant access to all Cloud Tasks resources within a project to a group of users. For more information, see Secure queue configuration.
Every Cloud Tasks method requires the caller to have the necessary
permissions. This page describes the permissions and roles that
Cloud Tasks supports. Permissions are also checked when
queue.yaml
or queue.xml
is updated or when the Google Cloud console is used.
Enable the Cloud Tasks API
To view and assign IAM roles for Cloud Tasks, you must enable the Cloud Tasks API for your project. You won't be able to see the Cloud Tasks roles in the Google Cloud console until you enable the API.
Console
Enable the Cloud Tasks API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM
role (roles/serviceusage.serviceUsageAdmin
), which
contains the serviceusage.services.enable
permission. Learn how to grant
roles.
gcloud
Enable the Cloud Tasks API:
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM
role (roles/serviceusage.serviceUsageAdmin
), which contains the
serviceusage.services.enable
permission. Learn how to grant
roles.
gcloud services enable cloudtasks.googleapis.com
Predefined roles
The following table lists the Cloud Tasks predefined IAM roles and their corresponding permissions.
The predefined roles address most typical use cases. If your use case isn't covered by the predefined roles, you can create an IAM custom role.
Role | Permissions |
---|---|
Cloud Tasks Admin Beta( Full access to queues and tasks. |
|
Cloud Tasks Enqueuer Beta( Access to create tasks. |
|
Cloud Tasks Queue Admin Beta( Admin access to queues. |
|
Cloud Tasks Service Agent( Grants Cloud Tasks Service Account access to manage resources. |
|
Cloud Tasks Task Deleter Beta( Access to delete tasks. |
|
Cloud Tasks Task Runner Beta( Access to run tasks. |
|
Cloud Tasks Viewer Beta( Get and list access to tasks, queues, and locations. |
|