Ravi Sir's Cards › AWS
OTP notifier with SNS
The Lambda generates a six-digit code and sends it to one confirmed SNS email subscriber. DynamoDB stores a keyed HMAC, expiry and attempt count. The raw code is never stored in the table. One conditional update validates and consumes the code. Test one successful use and then the same code again. Use Lambda console tests or IAM-authorized API routes. Set LAB_DEST, TOPIC_ARN and OTP_HMAC_SECRET.
Read card text
What this card says
Requests
The Lambda generates a six-digit code and sends it to one confirmed SNS email subscriber.
Store
DynamoDB stores a keyed HMAC, expiry and attempt count. The raw code is never stored in the table.
Verify
One conditional update validates and consumes the code. Test one successful use and then the same code again.
Lab setup
Use Lambda console tests or IAM-authorized API routes. Set LAB_DEST, TOPIC_ARN and OTP_HMAC_SECRET.