Google Cloud menawarkan Identity and Access Management (IAM), yang memungkinkan Anda memberikan akses ke resource Google Cloud tertentu dan mencegah akses yang tidak diinginkan ke resource lain. Halaman ini menjelaskan cara Cloud SQL diintegrasikan dengan
IAM .
Untuk mengetahui penjelasan mendetail tentang Google Cloud IAM, lihat
dokumentasi IAM.
Cloud SQL menyediakan serangkaian peran standar
yang dirancang untuk membantu Anda mengontrol akses ke resource Cloud SQL. Anda juga dapat membuat peran khusus sendiri, jika peran yang telah ditetapkan tidak menyediakan sekumpulan izin yang Anda perlukan.
Selain itu, peran dasar lama (Editor, Viewer, dan Pemilik) juga masih tersedia untuk Anda, meskipun tidak memberikan kontrol terperinci yang sama dengan peran Cloud SQL. Secara khusus, peran dasar
memberikan akses ke resource di seluruh Google Cloud, bukan hanya
untuk Cloud SQL. Untuk mengetahui informasi selengkapnya tentang peran Google Cloud dasar, lihat
Peran dasar.
Anda dapat menetapkan kebijakan IAM di level mana pun dalam
hierarki resource: level
organisasi, level folder, atau level project.
Resource mewarisi kebijakan semua resource induknya.
Saat menggunakan autentikasi IAM, izin untuk mengakses resource
(instance Cloud SQL) tidak diberikan langsung kepada pengguna akhir. Sebagai gantinya,
izin dikelompokkan ke dalam beberapa peran, dan peran tersebut diberikan kepada akun utama. Untuk
informasi lebih lanjut, lihat
Ringkasan IAM.
Kebijakan IAM mencakup entity berikut:
Akun utama.
Di Cloud SQL, Anda dapat menggunakan dua jenis akun utama: akun pengguna, dan akun layanan (untuk aplikasi).
Untuk mengetahui informasi selengkapnya, lihat
Konsep yang terkait dengan identitas.
Peran. Peran adalah kumpulan izin. Anda dapat memberikan peran kepada
akun utama untuk memberi mereka hak istimewa yang diperlukan untuk menyelesaikan
tugas tertentu. Untuk mengetahui informasi selengkapnya tentang peran IAM,
lihat Peran.
Resource. Resource yang diakses utama adalah instance Cloud
SQL. Secara default, binding kebijakan IAM diterapkan di
level project, sehingga akun utama menerima izin peran untuk semua
instance Cloud SQL dalam project.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[],[],null,["# IAM authentication\n\n\u003cbr /\u003e\n\n[MySQL](/sql/docs/mysql/iam-authentication \"View this page for the MySQL database engine\") \\| [PostgreSQL](/sql/docs/postgres/iam-authentication \"View this page for the PostgreSQL database engine\") \\| SQL Server\n\n\u003cbr /\u003e\n\nGoogle Cloud offers Identity and Access Management (IAM), which lets you give\naccess to specific Google Cloud resources and prevent unwanted\naccess to other resources. This page describes how Cloud SQL is integrated with\nIAM .\nFor a detailed description of Google Cloud IAM, see\n[IAM documentation](/iam/docs).\n\nCloud SQL provides a set of [predefined roles](/sql/docs/sqlserver/iam-roles)\ndesigned to help you control access to your Cloud SQL resources. You can\nalso create your own [custom roles](/sql/docs/sqlserver/iam-roles#custom-roles),\nif the predefined roles don't provide the sets of permissions you need.\nIn addition, the legacy basic roles (Editor, Viewer, and Owner) are also still\navailable to you, although they don't provide\nthe same fine-grained control as the Cloud SQL roles. In particular, the\nbasic roles provide access to resources across Google Cloud, rather than just\nfor Cloud SQL. For more information about basic Google Cloud roles, see\n[Basic roles](/iam/docs/understanding-roles#basic).\n\nYou can set an IAM policy at any level in the\n[resource hierarchy](/iam/docs/overview#resource-hierarchy): the\norganization level, the folder level, or the project level.\nResources inherit the policies of all of their parent resources.\n\nIAM references for Cloud SQL\n----------------------------\n\n- [Required permissions for common tasks in the Google Cloud console](/sql/docs/sqlserver/iam-permissions#permissions-console)\n- [Required permissions for `gcloud sql` commands](/sql/docs/sqlserver/iam-permissions#permissions-gcloud)\n- [Required permissions for Cloud SQL Admin API methods](/sql/docs/sqlserver/iam-permissions#api-methods)\n- [Predefined Cloud SQL IAM roles](/sql/docs/sqlserver/iam-roles#roles)\n- [Permissions and their roles](/sql/docs/sqlserver/iam-roles#permissions-roles)\n- [Custom roles](/sql/docs/sqlserver/iam-roles#custom-roles)\n\nIAM authentication concepts\n---------------------------\n\nWhen using IAM authentication, permission to access a resource\n(a Cloud SQL instance) isn't granted *directly* to the end user. Instead,\npermissions are grouped into *roles* , and roles are granted to *principals* . For\nmore information, see the\n[IAM overview](/iam/docs/overview).\n\n\u003cbr /\u003e\n\nIAM policies involve the following entities:\n\n- **Principals** . In Cloud SQL, you can use two types of principals: a *user account* , and a *service account* (for applications). For more information, see [Concepts related to identity](/iam/docs/overview#concepts_related_identity).\n- **Roles** . A role is a collection of permissions. You can grant roles to principals to provide them with the privileges required to accomplish specific tasks. For more information about IAM roles, see [Roles](/iam/docs/overview#roles).\n- **Resource**. The resources that principals access are Cloud SQL instances. By default, IAM policy bindings are applied at the project-level, such that principals receive role permissions for all Cloud SQL instances in the project."]]