Cognito listUsers with aws-sdk is very slow

Viewed 346

I'm creating one api with express-js and Cognito for users management, but every query in cognito takes at least 700ms to return the data... this is very slow!! How can i speed this up?

Have configs in AWS to reduce network delay?

import AWS from 'aws-sdk';

const Cognito = new AWS.CognitoIdentityServiceProvider({
  region: '...',
  accessKeyId: '...',
  secretAccessKey: '...',
});

const data = await Cognito.getUser({
  AccessToken
}).promise();

return {
  ...data,
  userName: data.Username,
};
0 Answers
Related