gcloud là control surface
Trước lệnh mutating: identity → configuration → target → permission → cost → rollback. Named configuration giúp tách lab/prod, nhưng vẫn phải đọc output; explicit --project/--region/--zone làm intent rõ hơn.
Output có thể audit
Dùng --format để chỉ hiển thị project/zone/status cần kiểm tra; dùng --filter để tránh đọc nhầm item. Ghi command và expected result, không ghi token. list/describe trước create/update/delete giúp phát hiện target sai.
Credential
User ADC, service account impersonation và key file có risk/lifecycle khác nhau. Ưu tiên short-lived/impersonation/workload identity; không commit key hoặc dùng account admin chung.
Bài tập
Viết hai configuration design và command runbook tạo lab VM (design-only): preflight context, explicit flags, expected output, failure/rollback và cleanup. Chạy read-only commands nếu environment cho phép.