Menyiapkan ADC untuk resource dengan akun layanan terlampir
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Beberapa Google Cloud layanan—seperti Compute Engine, App Engine, dan fungsi Cloud Run—mendukung pemasangan
akun layanan yang dikelola pengguna ke beberapa jenis resource.
Umumnya, pelampiran akun layanan didukung jika resource
layanan tersebut dapat berjalan atau menyertakan kode aplikasi. Saat Anda melampirkan akun layanan
ke resource, kode yang berjalan pada resource tersebut dapat menggunakan akun layanan tersebut sebagai
identitasnya.
Melampirkan akun layanan yang dikelola pengguna adalah cara yang lebih disukai untuk memberikan
kredensial ke ADC bagi kode produksi yang berjalan di Google Cloud.
[[["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-04-14 UTC."],[[["User-managed service accounts can be attached to certain Google Cloud resources, such as Compute Engine, App Engine, and Cloud Run, allowing application code to use that service account's identity."],["Attaching a user-managed service account is the recommended method for providing credentials to Application Default Credentials (ADC) for production code, rather than using the default service account, which often has overly broad privileges."],["To set up authentication, a user-managed service account needs to be created using the `gcloud iam service-accounts create` command."],["Roles must be granted to the service account to manage access to resources, using the `gcloud projects add-iam-policy-binding` command, ensuring the use of specific predefined or custom roles rather than overly broad roles like Owner, Editor, or Viewer."],["The principal attaching the service account to other resources needs the `roles/iam.serviceAccountUser` role, which is provided using the `gcloud iam service-accounts add-iam-policy-binding` command."]]],[]]