Google Professional Cloud DevOps Engineer Question 242
Single answerGoogle Cloud PlatformYour team is running a large-scale application on Google Cloud, and you are required to retain logs for compliance purposes for a minimum of 5 years. The logs are generated by Google Kubernetes Engine (GKE) and stored in Cloud Logging. Which approach should you take to ensure the logs are retained as per the compliance requirement?
- A
Set a custom retention period of 1825 days (5 years) in the Cloud Logging bucket.
- B
Export the logs to a Cloud Storage bucket configured with a lifecycle policy to retain objects for 5 years.
- C
Enable the default retention period of 30 days in Cloud Logging and rely on automatic backups.
- D
Export the logs to BigQuery and delete logs from Cloud Logging after the default retention period.
Show answer and explanation
Correct answer: B
Explanation
For compliance purposes requiring a 5-year retention period, Cloud Logging's maximum retention period (400 days) is insufficient. The recommended approach is to export logs to a Cloud Storage bucket, where you can configure a lifecycle policy to retain the logs for the required duration. This ensures compliance while leveraging Google Cloud's storage capabilities.
- A. Incorrect.
Incorrect: While Cloud Logging allows you to set custom retention periods, the maximum allowed retention period is only 400 days, which is insufficient for a 5-year compliance requirement.
- B. Correct.
Correct: Exporting logs to a Cloud Storage bucket with a lifecycle policy ensures that logs are retained for the required duration (5 years in this case). Cloud Storage offers the flexibility to configure retention policies to meet compliance needs.
- C. Incorrect.
Incorrect: The default retention period in Cloud Logging is only 30 days, which does not meet the 5-year retention requirement. Automatic backups are not a feature of Cloud Logging.
- D. Incorrect.
Incorrect: While exporting logs to BigQuery can help with analysis and long-term storage, it does not inherently enforce a retention policy. Additionally, deleting logs from Cloud Logging after the default retention period would violate the compliance requirement.