‫So now, let's talk about S3 Access Logs.
‫So for audit purposes,
‫you may want to log all the access made
‫into your S3 buckets.
‫So that means that any request made
‫to your S3 bucket from any account,
‫whether or not it's authorized or denied,
‫is going to be logged as a file into another S3 bucket.
‫And that data then can be analyzed using data analysis tool
‫such as Amazon Athena.
‫Now, the target logging buckets must also be
‫in the same AWS region.
‫So how does that work?
‫Well, you're going to request against your S3 buckets,
‫and then you're going to enable the access logs.
‫So that's all the requests are being logged
‫into the logging buckets.
‫Now, there's a specific format to this logs,
‫and you can find it at this URL
‫to find the log formats.
‫Now, with access logs, there is a little bit of warning.
‫Never ever set your logging bucket to be the same
‫as the bucket you are monitoring,
‫because otherwise, it will create a logging loop
‫and it will be infinite
‫and your bucket will grow in size exponentially.
‫So what does that mean?
‫While you do put object,
‫but the app bucket and the logging bucket is the same.
‫So there will be a logging loop
‫and you will log that again and log that again
‫and log that again and you will pay a lot of money.
‫So do not try this at home.
‫Okay, that's it for S3 access logs.
‫I hope you liked it,
‫and I will see you in the next lecture.