This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws cloudtrail describe-trails |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws cloudtrail delete-trail --name my-trail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws cloudtrail stop-logging --name my-trail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws cloudtrail update-trail --name my-trail --s3-bucket-name not-my-bucket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws cloudtrail update-trail --name my-trail --no-is-multi-region-trail --no-include-global-service-events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Id": "Key policy created for CloudTrail", | |
"Statement": [ | |
{ | |
"Sid": "Enable IAM User Permissions", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "[account-id]/[user-id]" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version":"2012-10-17", | |
"Statement":[ | |
{ | |
"Sid":"AWSCloudTrailAclCheck20150319", | |
"Effect":"Allow", | |
"Principal":{ | |
"Service":"cloudtrail.amazonaws.com" | |
}, | |
"Action":"s3:GetBucketAcl", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Owner": { | |
"DisplayName": "[user-name]", | |
"ID": "[user-id]" | |
}, | |
"Grants": [ | |
{ | |
"Grantee": { | |
"Type": "CanonicalUser", | |
"DisplayName": "[user-name]", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import urllib | |
import boto3 | |
s3 = boto3.client('s3') | |
def lambda_handler(event, context): | |
bucket = event['Records'][0]['s3']['bucket']['name'] | |
key = urllib.unquote_plus(event['Records'][0]['s3']['object']['key']).decode('utf8') | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"LambdaFunctionConfigurations": [ | |
{ | |
"LambdaFunctionArn": "arn:aws:lambda:[my-region]:[account-id]:function:[my-function]", | |
"Id": "[my-guid]", | |
"Events": [ | |
"s3:ObjectCreated:*" | |
] | |
} | |
] |
OlderNewer