In this recipe, we will learn how to create a trail in CloudTrail and how to read logs from the associated S3 bucket. By default, CloudTrail API event logs are made available for 90 days. The data events, such as S3 bucket operations and Lambda invocations are also not logged by default. To store our logs for more than 90 days, to enable logging data events from S3 or Lambda, and for additional flexibility in searching the logs, we can create a trail to log data in an S3 bucket.
Creating a trail in CloudTrail
Getting ready
We'll need a working AWS account to complete this recipe.