Created
February 22, 2019 17:26
-
-
Save 100daysofdevops/92dcf460fb854a14bdfcc9a552a26d3c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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