Skip to content

Instantly share code, notes, and snippets.

@100daysofdevops
Created February 22, 2019 17:26
Show Gist options
  • Select an option

  • Save 100daysofdevops/92dcf460fb854a14bdfcc9a552a26d3c to your computer and use it in GitHub Desktop.

Select an option

Save 100daysofdevops/92dcf460fb854a14bdfcc9a552a26d3c to your computer and use it in GitHub Desktop.
import json
import boto3
import sys
print('Loading function')
""" Function to define Lambda Handler """
def lambda_handler(event, context):
try:
client = boto3.client('cloudtrail')
if event['detail']['eventName'] == 'StopLogging':
response = client.start_logging(Name=event['detail']['requestParameters']['name'])
except Exception, e:
sys.exit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment