How to access Cognito Userpool from inside a lambda function?
问题 I'm using AWS Amplify for authentication in my app. I'm using email address as username and phone number for MFA. But, I also need the phone numbers to be unique, so I created this pre-signup lambda trigger: const aws = require('aws-sdk'); exports.handler = async (event, context, callback) => { const cognito = new aws.CognitoIdentityServiceProvider(); const params = { AttributesToGet: [], Filter: `phone_number = "${event.request.userAttributes.phone_number}"`, Limit: 1, UserPoolId: event