An engineer needs to set up secure, keyless access for an application running on a Google Compute Engine virtual machine to read data from BigQuery. Arrange the procedural steps in the correct chronological order to achieve this setup following Google Cloud best practices.
- 1Create a new user-managed service account using the `gcloud iam service-accounts create` command.
- 2Grant the required BigQuery IAM role to the service account using `gcloud projects add-iam-policy-binding`.
- 3Provision the Compute Engine VM instance and attach the service account using the `--service-account` flag in `gcloud compute instances create`.
- 4Run the application on the VM instance to implicitly authenticate using Application Default Credentials (ADC) without downloading service account keys.
Cevap
The correct sequence of steps is: 1) Create the user-managed service account using gcloud, 2) Grant the necessary BigQuery IAM role to the service account identity, 3) Attach the service account to the Compute Engine VM instance upon creation, and 4) Run the application to authenticate keylessly via Application Default Credentials.
The proper sequence requires initializing the service account identity first, granting least-privilege IAM roles to that identity second, attaching the service account identity to the VM instance during creation third, and finally letting the application authenticate keylessly via Application Default Credentials.
Adım Adım Çözüm
Anahtar Kavram
Creating and Managing Service Accounts