やり方
@aws-sdk/client-cognito-identity-providerの AdminUpdateUserAttributesCommandを実行する。
const updateAttrCmd = new AdminUpdateUserAttributesCommand({
UserPoolId: this.userPoolId,
Username: userName,
UserAttributes: [
{
Name: 'email',
Value: email,
},
],
});注意点
- 対象ユーザの指定は
UserNameでしか絞込みはできない。- エイリアスを張っているAttributeも可(
Emailなど)
- エイリアスを張っているAttributeも可(