Basic Example flow
1. Basic Python Code
2. Create a lambda function
3. Replace function insider handler - change handler - entry point
5. Add Trigger to invoker from outside / Gateway
6. Test from Browser
Keep Exploring
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 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:
Post a Comment