Your event coming from Lex into Lambda will look something like the JSON object below. The example is for a bot called "TimerTest". The intent that was matched was called "MATCHED_INTENT_NAME". The slot is called "Name". If you want to run validation for the slot called "Name", you can reference the slot value as event.currentIntent.slots.Name in Lambda to run your validation code.
{
"messageVersion": "1.0",
"invocationSource": "FulfillmentCodeHook",
"userId": "UNIQUE_USER_ID",
"sessionAttributes": {},
"requestAttributes": null,
"bot": {
"name": "TimerTest",
"alias": "$LATEST",
"version": "$LATEST"
},
"outputDialogMode": "Text",
"currentIntent": {
"name": "MATCHED_INTENT_NAME",
"slots": {
"Name": "test"
},
"slotDetails": {
"Name": {
"resolutions": [],
"originalValue": "test"
}
},
"confirmationStatus": "None"
},
"inputTranscript": "test"
}
Additional information can be found here: https://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html
Hope this helps.