Skip to content

Instantly share code, notes, and snippets.

@100daysofdevops
Created February 13, 2019 00:14
Show Gist options
  • Save 100daysofdevops/0040aec519b8c4a38d3cd2bca07133eb to your computer and use it in GitHub Desktop.
Save 100daysofdevops/0040aec519b8c4a38d3cd2bca07133eb to your computer and use it in GitHub Desktop.
# Create Trail(Single Region)
aws cloudtrail create-trail --name my-test-cloudtrail --s3-bucket-name mytests3bucketforcloudtrail
# Create Trail(That applies to multi-region)
aws cloudtrail create-trail --name my-test-cloudtrail-multiregion --s3-bucket-name mytests3bucketforcloudtrail --is-multi-region-trail
# To get the status/list all the trails
aws cloudtrail describe-trails
# Start logging for the trail
aws cloudtrail start-logging --name my-test-cloudtrail
# To verify if logging is enabled
aws cloudtrail get-trail-status --name my-test-cloudtrail
# To enable log file validation
aws cloudtrail create-trail --name my-test-cloudtrail-multiregion-logging --s3-bucket-name mytests3bucketforcloudtrail --is-multi-region-trail --enable-log-file-validation
# To delete a particular trail
aws cloudtrail delete-trail --name my-test-cloudtrail-multiregion-logging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment