Created
August 22, 2019 00:36
-
-
Save djg07/678f7aea58b6c5b8d93c15af8577e0f2 to your computer and use it in GitHub Desktop.
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 | |
print('Loading function') | |
def lambda_handler(event, context): | |
#1. Parse out query string params | |
transactionId = event['queryStringParameters']['transactionId'] | |
transactionType = event['queryStringParameters']['type'] | |
transactionAmount = event['queryStringParameters']['amount'] | |
print('transactionId=' + transactionId) | |
print('transactionType=' + transactionType) | |
print('transactionAmount=' + transactionAmount) | |
#2. Construct the body of the response object | |
transactionResponse = {} | |
transactionResponse['transactionId'] = transactionId | |
transactionResponse['type'] = transactionType | |
transactionResponse['amount'] = transactionAmount | |
transactionResponse['message'] = 'Hello from Lambda land' | |
#3. Construct http response object | |
responseObject = {} | |
responseObject['statusCode'] = 200 | |
responseObject['headers'] = {} | |
responseObject['headers']['Content-Type'] = 'application/json' | |
responseObject['body'] = json.dumps(transactionResponse) | |
#4. Return the response object | |
return responseObject | |
thanks
Thank! So cool your video. It just work
Thank you Daniel
Thanks
Thanks.
I folowed your tutorial on youtube. getting internal server error
Thank you
I folowed your tutorial on youtube. getting internal server error
Same here. Does anyone know the solution?
Works perfectly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks man!