I am trying to create a simple Lambda function ChildFunction with the following Code:
import json
import uuid
def lambda_handler(event, context):
productName = event['ProductName']
quantity = event['Quantity']
unitPrice = event['UnitPrice']
transactionId = str(uuid.uuid1())
amount = quantity * unitPrice
return {
'TransactionID' : transactionId,
'ProductName' : productName,
'Amount' : amount
}
I am creating a Test Event with the following Test parameters:
{
"ProductName": "iPhone SE",
"Quantity": "2",
"UnitPrice": "499"
}
When I execute the Test Event, I am getting the following output:
Response:
{
"statusCode": 200,
"body": "\"Hello from Lambda!\""
}
Request ID:
"9c68e0d8-3781-4046-ac26-127c45321d71"
Function logs:
START RequestId: 9c68e0d8-3781-4046-ac26-127c45321d71 Version: $LATEST
END RequestId: 9c68e0d8-3781-4046-ac26-127c45321d71
REPORT RequestId: 9c68e0d8-3781-4046-ac26-127c45321d71 Duration: 1.19 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 52 MB
I don't know why the Lambda Function is not executing. What am I doing wrong here?
Execution result: succeededwhen I hit Test. but it does not gives any output.