Lambda functions
Lambda functions
Lambda is special service in AWS makes event-driven development much more accessible and easier. Lambda allows you to execute function after some kind of event.
Let's see this in action, so that would be more easier to understand. So what I will do is, I will create a lambda function which will be triggered when someone do some operation on my S3 bucket then it will log a simple message.
- First need to search lambda in dashboard
- We will use this code blockimport jsonimport logginglogger = logging.getLogger()logger.setLevel(logging.INFO)def lambda_handler(event, context):logger.info("Python is awesome")return {'statusCode': 200,'body': 'Log entry created'}
- And after completing steps above you need to either delete or upload something to that bucket.
Comments
Post a Comment