I'm trying to create a function which allows me to update a user's phone number in a Cognito User Pool. The code is in a NodeJS application, using the latest aws-sdk library.

I have this function callback structure working for a number of other actions against the user pool, e.g. creating and listing users, updating MFA, etc. So I am confident there's nothing structurally wrong with the way I have laid the code out.

But for this particular function, I am receiving an error that says AdminUpdateUserAttributes "is not a function".

I've tried changing different attributes in case it's a phone number thing, but I got the same result.

```
function cognitoUpdatePhone(username, phoneNumber, callback) {

        var params = {
            UserPoolId: '<my pool Id>',
            Username: username,
            UserAttributes: {
                phone_number: phoneNumber
            }
        };

        var cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
        cognitoidentityserviceprovider.AdminUpdateUserAttributes(params, function (err, data) {
            if (err) {
                callback(err, false);
            }
            else {
                callback(null, true);
            }
        });    
}

```

I'm getting following response from the server. The stack trace indicates the source of the error is: aws-sdk/lib/state\_machine.js

```
  message: 'cognitoidentityserviceprovider.AdminUpdateUserAttributes is not a function',
  code: 'TypeError',

```