Review Alicloud Simple Log Service retention

Keep logs for the period needed for investigation and audit.

Description

retention_period sets the number of days logs remain in a Simple Log Service Logstore. A period shorter than required can remove historical records before investigation.

Potential impact

Reconstructing an outage or security incident and obtaining audit evidence may become difficult.

Remediation

Set retention_period according to internal policy and investigation needs. Where at least 90 days are required, retain at least 90 days and manage storage costs and access permissions.

Examples

The examples extend retention from 60 to 91 days. Choose the actual period according to the data and organizational requirements.

Before

hcl
resource "alicloud_log_store" "example" {
  project               = alicloud_log_project.example.name
  name                  = "tf-log-store"
  retention_period      = 60
  shard_count           = 3
  auto_split            = true
  max_split_shard_count = 60
  append_meta           = true
}

After

hcl
resource "alicloud_log_store" "example" {
  project               = alicloud_log_project.example.name
  name                  = "tf-log-store"
  retention_period      = 91
  shard_count           = 3
  auto_split            = true
  max_split_shard_count = 60
  append_meta           = true
}

References