nerdexam
Amazon

SOA-C02 · Question #735

A SysOps administrator is examining costs in a development account that is part of an organization in AWS Organizations. The account includes Amazon CloudWatch Logs log groups that are set to never ex

The correct answer is A. Create a Lambda function that uses the PutRetentionPolicy operation to set the retention period to. Trigger a Lambda function via an EventBridge rule on the CreateLogGroup event, and have the function call PutRetentionPolicy to set 3 days. This automatically enforces the retention on every

Submitted by omar99· Mar 30, 2026Monitoring, Logging, and Remediation

Question

A SysOps administrator is examining costs in a development account that is part of an organization in AWS Organizations. The account includes Amazon CloudWatch Logs log groups that are set to never expire. The log groups are associated with several AWS Lambda functions that are invoked by Amazon EventBridge rules. The SysOps administrator needs to implement a solution to automate a 3-day retention period for any log groups that are created in the future. Which solution will meet these requirements?

Options

  • ACreate a Lambda function that uses the PutRetentionPolicy operation to set the retention period to
  • BUse the AWS Config cw-loggroup-retention-period-check managed rule to set the retention period
  • CCreate a Lambda function that uses the PutRetentionPolicy operation to set the retention period to
  • DCreate an AWS CloudFormation template that uses the AWS::Logs::ResourcePolicy resource.

How the community answered

(51 responses)
  • A
    84% (43)
  • B
    10% (5)
  • C
    2% (1)
  • D
    4% (2)

Explanation

Trigger a Lambda function via an EventBridge rule on the CreateLogGroup event, and have the function call PutRetentionPolicy to set 3 days. This automatically enforces the retention on every

Topics

#CloudWatch Logs retention#PutRetentionPolicy#Lambda automation#EventBridge trigger

Community Discussion

No community discussion yet for this question.

Full SOA-C02 Practice