Buckets should have logging enabled so that access can be audited.
Server access logging provides detailed records for the requests that are made to a bucket. Server access logs are useful for many applications.
For example, access log information can be useful in security and access audits. It can also help you learn about your customer base and understand your Amazon S3 bill. Enable logging by specifying target_bucket
and target_prefix
in the logging object.
resource "aws_s3_bucket" "my-bucket" {
}
resource "aws_s3_bucket" "my-bucket" {
logging {
target_bucket = "target-bucket"
}
}