Soru

Zorluk: KolayCreating and Managing Service Accounts

You are configuring access controls for a new microservice in your Google Cloud project. You need to create a new user-managed service account named 'app-monitoring-sa' using the Google Cloud Command-Line Interface (CLI). Which gcloud command should you run to create this service account?

  1. gcloud iam service-accounts create app-monitoring-sa --display-name="App Monitoring SA"Cevap
  2. B
    gcloud iam roles create app-monitoring-sa --display-name="App Monitoring SA"
  3. C
    gcloud compute service-accounts create app-monitoring-sa
  4. D
    gcloud iam service-accounts keys create app-monitoring-sa

Cevap

The command 'gcloud iam service-accounts create app-monitoring-sa --display-name="App Monitoring SA"' correctly provisions the user-managed service account.
To create a user-managed service account using the Google Cloud CLI, the correct command syntax is 'gcloud iam service-accounts create [SA_NAME]'. Including a display name provides descriptive metadata visible in the Cloud Console.

Adım Adım Çözüm

1
Identify the gcloud CLI command group for managing service account resources
Service account operations belong to 'gcloud iam service-accounts'.
IAM is responsible for identity management in Google Cloud, including user-managed service accounts.
2
Specify the creation subcommand and account identifier
Use 'create app-monitoring-sa' followed by descriptive flags such as '--display-name'.
This creates the service account resource with a generated email identifier formatted as [SA_NAME]@[PROJECT_ID].iam.gserviceaccount.com.

Anahtar Kavram

Creating User-Managed Service Accounts via gcloud CLI
Bu soruyu puanla