A cloud engineer needs to configure a fine-grained custom IAM role for a service account using the gcloud CLI to enforce least privilege access in a Google Cloud project. What is the correct sequence of steps to create the custom role, provision the service account, and apply the required access permissions?
- 1Draft a YAML file defining the custom role metadata, launch stage, and specific permissions list.
- 2Run `gcloud iam roles create` referencing the YAML file to register the custom role in the project.
- 3Run `gcloud iam service-accounts create` to provision the service account identity.
- 4Run `gcloud projects add-iam-policy-binding` to grant the custom role to the service account.
Cevap
The correct operational order is to draft the custom role YAML definition file, run `gcloud iam roles create` to create the role resource, run `gcloud iam service-accounts create` to provision the service account identity, and finally execute `gcloud projects add-iam-policy-binding` to assign the role to the service account.
The sequence follows mandatory resource dependencies: permissions are defined in a specification file, the custom role is registered in GCP IAM, the target service account identity is provisioned, and finally the role is bound to the identity using project policy bindings.
Adım Adım Çözüm
Anahtar Kavram
Managing IAM Roles and Resource Access Permissions via gcloud CLI
Tahmini Süre:1m 30s