Google Associate Cloud Engineer Question 232
Select 2Google Cloud PlatformYou are tasked with ensuring that objects in your Google Cloud Storage bucket are protected from accidental deletion. Which of the following actions should you take to achieve this?
- A
Enable Object Versioning on the bucket.
- B
Apply a Retention Policy to the bucket.
- C
Grant 'Storage Object Admin' role to all users.
- D
Enable Bucket Policy Only for the bucket.
- E
Set IAM conditions on bucket-level policies.
Show answer and explanation
Correct answers: A, B
Explanation
To protect objects from accidental deletion in Cloud Storage, you should enable Object Versioning to retain previous versions of objects and apply a Retention Policy to prevent deletions within a specified time frame. These actions ensure that there are mechanisms in place to recover objects or prevent their deletion entirely until a certain period has passed.
- A. Correct.
Enabling Object Versioning allows you to keep previous versions of an object, which can be restored if an object is accidentally deleted.
- B. Correct.
Applying a Retention Policy prevents objects from being deleted or overwritten until a specified retention period has elapsed.
- C. Incorrect.
Granting 'Storage Object Admin' role to all users increases the risk of accidental deletions, as it provides broad permissions.
- D. Incorrect.
Enabling Bucket Policy Only simplifies permissions management but does not directly protect against accidental deletion.
- E. Incorrect.
Setting IAM conditions can help with fine-grained access control but does not specifically prevent accidental deletions.