AWS DevOps Engineer Professional Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the AWS DevOps Engineer Professional Test. Enhance your skills with flashcards and multiple-choice questions, each offering hints and explanations. Become exam-ready!

Practice this question and more.


How can you retain CloudWatch metrics for an extended time period, such as 7 years?

  1. Store metrics in an RDS database

  2. Export the metrics using a Lambda function

  3. Use CloudWatch Logs to archive metrics

  4. Implement retention policies within CloudWatch

The correct answer is: Export the metrics using a Lambda function

Exporting CloudWatch metrics using a Lambda function is an effective way to retain those metrics for an extended time period, such as 7 years. By creating a Lambda function that retrieves the metrics at specified intervals, you can send those metrics to a storage solution of your choice, such as Amazon S3 or a database. This provides you with the flexibility to store, query, and analyze your metrics over a long period while ensuring that they are not subject to CloudWatch's default retention policies. This method not only allows you to preserve the metrics beyond their native retention but also enables you to structure the storage in a way that fits your analytic needs and compliance requirements, making it ideal for long-term data retention strategies. Other methods such as storing metrics in an RDS database might also retain data long-term, but the direct extraction and archiving mechanism provided by the Lambda function to provision storage solutions is more aligned with a continuous data retention strategy for CloudWatch metrics. Implementing retention policies within CloudWatch could help manage how long data is kept but wouldn’t extend the retention beyond what CloudWatch offers. Using CloudWatch Logs to archive metrics can be useful, but the logs are primarily intended for log data rather than structured metric storage.