Amazon web services Cognito注册上的电话号码格式无效

Amazon web services Cognito注册上的电话号码格式无效,amazon-web-services,amazon-cognito,Amazon Web Services,Amazon Cognito,我正试图通过nodeJS在我的cognito用户池中创建一个新用户,但我一直收到错误的电话号码错误…但我使用相同的号码格式通过SNS服务发送短信,我不明白为什么会发生这种情况 报名方式: module.exports.post = async (username,password,email,phoneNumber) => { const environment = { UserPoolId: xxxxxxx, ClientId: xxxxxx,

我正试图通过nodeJS在我的cognito用户池中创建一个新用户,但我一直收到错误的电话号码错误…但我使用相同的号码格式通过SNS服务发送短信,我不明白为什么会发生这种情况

报名方式:

module.exports.post = async (username,password,email,phoneNumber) => {
    const environment = {
        UserPoolId: xxxxxxx,
        ClientId: xxxxxx,
    }
    return new Promise((reject,resolve) => {
        const userPool = new AmazonCognitoIdentity.CognitoUserPool(environment);
        const emailData = {
            Name: 'Email',
            Value: email
        };
        const userData = {
            Name: 'Usuário',
            Value: username
        };
        const phoneData = {
            Name: 'Telefone',
            Value: phoneNumber
        };
        const emailAttribute = new AmazonCognitoIdentity.CognitoUserAttribute(emailData);
        const userAttribute = new AmazonCognitoIdentity.CognitoUserAttribute(userData);
        const phoneAttribute = new AmazonCognitoIdentity.CognitoUserAttribute(phoneData);

        userPool.signUp(username,password,[emailAttribute,userAttribute, phoneAttribute], null, (err,data) => {
        if(err) console.log(err);
        resolve(data);
        });
    });
}
正在传递的数字格式:

+5521979724910
错误:

{ code: 'InvalidParameterException',
  name: 'InvalidParameterException',
  message: '1 validation error detected: Value \'phone number\' at \'userAttributes.2.member.name\' failed to satisfy constraint: Member must satisfy regular expression pattern: [\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]+' }

有什么想法吗?

属性值应该是
phone\u number
而不是
Telefone

const phoneData = {
        Name : 'phone_number',
        Value : '+15555555555'
    };

使用属性名称作为“电话号码”

注意:添加国家代码和电话号码值。否则它将抛出另一个错误