I am trying to create an AWS lambda function that help user collect data from a website (using selenium and headless-chromium). The website requires sms code verification during login so I need to get it from the user and pass it back to the AWS Lambda function
the flow will be:

username & password send to lambda function
lambda function start, chromium auto login with username & password
waiting for sms code from user
user enter sms code, code pass to lambda function
lambda function continue

is it possible to do so? like the input() function when running python locally
thanks!!
*first question in stackoverflow! let me know if anything doesn't make sense
We need at least two Lambdas.
Second Lambda:

Takes OTP & UserId as input.
Writes a record to DynamoDb with userId and OTP.

First Lambda:

Lambda is invoked with user Id and password
Start a selenium browser session.
Login and write a record to Dynamo.
Keep checking Dynamo every second for an entry for userId with OTP in Dynamo.
Set a timeout and complete Login Process.

Main disadvantage of this approach is we have first Lambda running for entire time of login. But if we can't break the login and OTP process, I don't see another way.
May be having a ECS Fargate task instead of Lambda function may save some cost as we can easily run multiple selenium browser sessions in single ECS Task.
AWS Lambda: Python user input possible?