Skip to content

Instantly share code, notes, and snippets.

@paulwakeford
Last active August 15, 2016 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulwakeford/a3ad1f390b1f270c6570 to your computer and use it in GitHub Desktop.
Save paulwakeford/a3ad1f390b1f270c6570 to your computer and use it in GitHub Desktop.
Enable CloudTrail for all regions
for i in `aws ec2 describe-regions --region ap-southeast-2 --query 'Regions[*].RegionName' --output text`; do aws cloudtrail --region $i create-trail --name Default --s3-bucket-name BUCKETNAME-HERE `[[ "$i" = "ap-southeast-2" ]] && echo "--include-global-service-events" || echo "--no-include-global-service-events"`; aws cloudtrail --region $i start-logging --name Default; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment