이 제품은 선택한 Datadog 사이트에서 지원되지 않습니다. ().
이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우 언제든지 연락주시기 바랍니다.

Metadata

Id: ansible-aws-cloudwatch-without-retention-period-specified

Provider: AWS

Platform: Ansible

Severity: Low

Category: Observability

Learn More

Description

CloudWatch Log Groups must have a defined retention period to retain logs for incident investigation and regulatory compliance. Without one, indefinite retention increases storage costs and the risk of long-term data exposure.

For Ansible tasks using amazon.aws.cloudwatchlogs_log_group or cloudwatchlogs_log_group, the retention property must be set to one of the AWS-supported retention periods: [1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, 3653]. Resources missing retention or with a value not in this list are flagged as misconfigured.

Secure configuration example:

- name: Create CloudWatch log group with retention
  amazon.aws.cloudwatchlogs_log_group:
    name: my-log-group
    retention: 365

Compliant Code Examples

- name: example3 ec2 group
  amazon.aws.cloudwatchlogs_log_group:
    log_group_name: test-log-group
    retention: 5

Non-Compliant Code Examples

- name: example ec2 group
  amazon.aws.cloudwatchlogs_log_group:
    log_group_name: test-log-group
- name: example2 ec2 group
  amazon.aws.cloudwatchlogs_log_group:
    log_group_name: test-log-group
    retention: 111111