Description
CloudTrail can notify an SNS topic when a new log file reaches S3. Monitor the events inside the file separately if you need security alerts.
Potential impact
A job triggered by SNS may miss new files if delivery notifications are absent.
Remediation
If your workflow needs notifications, set sns_topic_name, allow CloudTrail to publish and subscribe the receiving system. Confirm it receives a notification for a newly delivered file. If you use another trigger, verify that it picks up the file.
Examples
Replace some-topic with the topic your consumer subscribes to. The excerpts omit the trail name and S3 bucket.
Before
hcl
resource "aws_cloudtrail" "example" {
# ... other configuration ...
}
After
hcl
resource "aws_cloudtrail" "example" {
# ... other configuration ...
sns_topic_name = "some-topic"
}