Menyiapkan ADC untuk penyedia cloud lokal atau lainnya
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Jika menjalankan aplikasi di luar Google Cloud, Anda harus
memberikan kredensial yang dikenali oleh Google Cloud untuk
menggunakan layanan Google Cloud .
Workload Identity Federation
Cara yang lebih disukai untuk mengautentikasi dengan Google Cloud menggunakan kredensial dari
IdP eksternal adalah dengan menggunakan Workload Identity Federation;
Anda membuat file konfigurasi kredensial dan menetapkan
variabel lingkungan GOOGLE_APPLICATION_CREDENTIALS untuk menunjukkannya. Pendekatan
ini lebih aman daripada membuat kunci akun layanan.
Jika tidak dapat mengonfigurasi Workload Identity Federation, Anda harus
membuat akun layanan, memberinya peran IAM yang
diperlukan aplikasi, dan membuat kunci untuk akun layanan.
Untuk membuat kunci akun layanan dan menyediakannya bagi ADC:
Buat akun layanan dengan peran yang dibutuhkan aplikasi Anda, serta kunci
untuk akun layanan tersebut, dengan mengikuti petunjuk dalam
Membuat kunci akun layanan.
Set the environment variable GOOGLE_APPLICATION_CREDENTIALS
to the path of the JSON file that contains your credentials.
This variable applies only to your current shell session, so if you open
a new session, set the variable again.
Example: Linux or macOS
exportGOOGLE_APPLICATION_CREDENTIALS="KEY_PATH"
Replace KEY_PATH with the path of the JSON file that contains your credentials.
[[["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."],[[["If running applications outside of Google Cloud, you need to provide credentials recognized by Google Cloud to access its services."],["Workload Identity Federation is the recommended method for authenticating with Google Cloud using external credentials, as it is more secure than service account keys."],["If Workload Identity Federation is not feasible, service account keys can be used, but they pose a security risk and should be avoided if possible."],["To use service account keys, create a service account with the necessary roles, generate a key, and set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the key file's path."],["The `GOOGLE_APPLICATION_CREDENTIALS` environment variable directs Application Default Credentials (ADC) to the specified credential location, and it takes precedence over other credential locations."]]],[]]