forked from 100daysofdevops/100daysofdevops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudtrail_aws_cli
20 lines (14 loc) · 872 Bytes
/
cloudtrail_aws_cli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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