def lambda_handler()

in code/lab-3/quotes-response-service/app.py [0:0]


def lambda_handler(event, context):
    print('received event: {}'.format(json.dumps(event)))

    # we configured the event source to only receive one message at a time
    msg = json.loads(event['Records'][0]['body'])

    # store the received response message in our DynamoDB table for the given rfq-id
    response = dynamodb.put_item(
        TableName = TABLE_NAME, 
        Item = {
            'id': {'S': msg['rfq-id']},
            'responder': {'S': msg['responder']},
            'quote': {'N': str(msg['quote'])}
        }
    )

    return