Before writing any code, we need to set up three things: an IAM role for Lambda, a DynamoDB table to store songs, and a Cognito user pool for authentication.
Lambda functions need permission to access DynamoDB and write logs to CloudWatch.

Search and attach these two policies:
AmazonDynamoDBFullAccessCloudWatchLogsFullAccessName the role lambda-workshop-role → Create role
In a real production environment, you would use a more restrictive policy. For this workshop, these managed policies keep things simple.
We need two tables: one for users and one for songs.

Configure:
songssongId (String)Click Create table

Once the table is created, add a few items manually so GET /songs has data to return.
songs table → Explore table items → Create item{
"songId": { "S": "1" },
"title": { "S": "Lạc Trôi" },
"artist": { "S": "Sơn Tùng M-TP" },
"genre": { "S": "vpop" }
}

Configure sign-in:
On the App client step:
workshop-clientALLOW_USER_PASSWORD_AUTH and ALLOW_REFRESH_TOKEN_AUTHName the user pool workshop-pool → Create user pool

us-east-1_XXXXXXX)In your user pool → Users → Create user
Configure:
test@example.comTest@12345The user will be in Force change password state. Set a permanent password via AWS CLI:
aws cognito-idp admin-set-user-password \
--user-pool-id <YOUR_USER_POOL_ID> \
--username test@example.com \
--password "Test@12345" \
--permanent
The user is now ready to log in.