Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Associate Cloud Engineer practice bank has an additional 2,014 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your team manages several project-level custom IAM roles using configuration files and the gcloud CLI. Multiple cloud administrators have permission to modify these roles. You need to add additional permissions to an existing custom role named customAppViewer in the project corp-app-prod. You must ensure that any concurrent updates made by other team members are not accidentally overwritten.
What should you do?
gcloud iam roles describe customAppViewer --project=corp-app-prod to get the current role definition and its etag, update the YAML file with the new permissions and the retrieved etag, and run gcloud iam roles update customAppViewer --project=corp-app-prod --file=role-definition.yaml.The standard and recommended mechanism for safely updating an existing custom Identity and Access Management (IAM) role in Google Cloud is the read-modify-write pattern. Because custom roles are managed as API resource objects, concurrent changes by different administrators or automated scripts can cause race conditions. Google Cloud IAM solves this problem by including an etag property in each custom role's metadata. The etag is a unique fingerprint that identifies the specific version of the role definition.
gcloud iam roles describe returns the complete current role definition along with its current etag string (for example, BwVkBkbfr70=).etag is submitted via gcloud iam roles update, IAM compares the submitted etag against the role's current etag in Google Cloud. If another administrator has modified the role in the interim, the etag values will not match, causing IAM to reject the request and prevent accidental data loss.includedPermissions list locally, confident that the update will succeed only if the role has not been modified since it was inspected.Using gcloud iam roles describe to extract the etag followed by gcloud iam roles update --file=... is the official and safest process for updating custom roles. It protects administrative changes from being overwritten by simultaneous updates.
gcloud iam roles create customAppViewer --folder=FOLDER_ID, so that IAM automatically merges and versions conflicting role updates across child projects.Google Cloud organizes resources in a hierarchy consisting of Organizations, Folders, Projects, and individual Resources. IAM allow policies can be attached to folders so that permissions inherit downward to child projects and resources.
gcloud iam roles create command does not accept a --folder flag because folders cannot host custom role resources.--organization flag. They can be granted on the organization, any folder within it, or any project within it.--project flag. They can only be granted within that specific project and its resources.You wanted to share a custom role across multiple projects in a folder by defining the custom role at the organization level, and then binding that role in an allow policy at the folder level.
storage.objects.*, and run gcloud iam roles update customAppViewer --project=corp-app-prod --file=role-definition.yaml --force to override concurrency checks.In many CLI tools and configuration systems, wildcards (*) represent pattern matching across multiple actions, and flags like --force are used to bypass safety confirmations or concurrency controls.
*) in permission names. Every permission included in a custom role must be explicitly declared (for example, storage.objects.get and storage.objects.list). If a wildcard is provided, the API returns an INVALID_ARGUMENT error.--force Flag for Concurrency: The gcloud iam roles update command does not possess a --force flag to circumvent version verification or overwrite concurrent changes.SUPPORTED (or TESTING) support level can be included, and each must be fully typed.Google Cloud IAM supported wildcard globbing in role permission arrays, similar to how AWS IAM policy statements or Kubernetes RBAC verbs function, but GCP IAM custom roles require explicit enumeration.
gcloud iam roles delete customAppViewer --project=corp-app-prod, update your local YAML file with the new permissions, and immediately recreate the role using gcloud iam roles create customAppViewer --project=corp-app-prod --file=role-definition.yaml.The gcloud iam roles delete command flags a custom role for deletion. In Google Cloud IAM, deleting a custom role starts a mandatory 44-day deletion process rather than immediately purging the identifier from the project.
customAppViewer will fail with an error.gcloud iam roles undelete during the 44-day window.You intended to permanently retire the role, knew that no principals were currently assigned to it, and had no intention of reusing the role ID within the project for at least 44 days.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated