To access Google Cloud SQL resources, grant the following IAM role to the Google Cloud service account:
-
Role: roles/cloudsql.viewer
-
Cloud SQL Viewer: Provides read-only access to Cloud SQL resources.
You can create a custom IAM role instead of using the predefined Cloud SQL Viewer role. The following permissions are required to perform these operations successfully.
Cloud SQL Permissions
| Permission | Description |
|---|---|
| cloudsql.instances.get | View Cloud SQL instance details. |
| cloudsql.instances.list | List Cloud SQL instances. |
Resource Manager Permissions
| Permission | Description |
|---|---|
| resourcemanager.projects.get | View Google Cloud project information. |