"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

January 31, 2023

AWS Lambda Basics

 Basic Example flow

1. Basic Python Code

2. Create a lambda function


3. Replace function insider handler - change handler - entry point


4. Test the handler



5. Add Trigger to invoker from outside / Gateway


6. Test from Browser


Keep Exploring
import json
import random
def return_drink():
drinks = ['beer','vodka','rum','lemon','orange','water']
return random.choice(drinks)
def lambda_handler(event, context):
drink = return_drink()
message = f'you should drink- {drink}'
# TODO implement
return {
'statusCode': 200,
'body': json.dumps(message)
}


Ref - Link

Performance profiling

Happy Learning!!!

No comments: