EndemolShineGroup/serverless-test-utils

View on GitHub
src/aws/cognitoUserPool/createCognitoUser.ts

Summary

Maintainability
A
0 mins
Test Coverage
import AWS from 'aws-sdk';

export default async (
  userPoolId: string,
  username: string,
  password: string,
) => {
  const cognito = new AWS.CognitoIdentityServiceProvider();

  const params = {
    TemporaryPassword: password,
    UserPoolId: userPoolId,
    Username: username,
  };
  return cognito.adminCreateUser(params).promise();
};