avatar
query list of user and filter cognito in lambda function Lambda
var AWS = require("aws-sdk");
var amplify = new AWS.Amplify();

const cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider({
    region: amplify.config.region
});

exports.handler =  function(event, context, callback) {  
  var params = {
    UserPoolId: "us-west-2_3432SDF23",
    AttributesToGet: ["email"],
    Filter: "email ^= \"[email protected]\""
  };

  cognitoidentityserviceprovider.listUsers(params, (err, data) => {
    if (err) {
      callback(err)        
    } else {
      callback(null, data) 
    }
  });
 
}
You need to login to do this manipulation!