Skip to content

Instantly share code, notes, and snippets.

aws cloudtrail describe-trails
aws cloudtrail delete-trail --name my-trail
aws cloudtrail stop-logging --name my-trail
aws cloudtrail update-trail --name my-trail --s3-bucket-name not-my-bucket
aws cloudtrail update-trail --name my-trail --no-is-multi-region-trail --no-include-global-service-events
{
"Version": "2012-10-17",
"Id": "Key policy created for CloudTrail",
"Statement": [
{
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {
"AWS": "[account-id]/[user-id]"
},
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"AWSCloudTrailAclCheck20150319",
"Effect":"Allow",
"Principal":{
"Service":"cloudtrail.amazonaws.com"
},
"Action":"s3:GetBucketAcl",
{
"Owner": {
"DisplayName": "[user-name]",
"ID": "[user-id]"
},
"Grants": [
{
"Grantee": {
"Type": "CanonicalUser",
"DisplayName": "[user-name]",
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],