0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Cognitoでユーザー登録時の、LimitExceededExceptionのエラー

Last updated at Posted at 2025-04-01

エラー内容

Cognitoでユーザー登録をしたときに、メール送信が1日に送信できる上限を超えたという内容のエラーが発生した

LimitExceededException: Exceeded daily email limit for the operation or the account. If a higher limit is required, please configure your user pool to use your own Amazon SES configuration for sending email.

前提

  • AdminCreateUser APIを使用している
  • user_verifiedをtrueにして登録しているので認証メールは飛ばないようになっている
  • 何もメール送信したくない

わかったこと

  • AdminCreateUser API を使用してユーザーを手動で作成すると、招待メールがデフォルトで送信されてしまう
  • それがカウントされて、1日の上限に引っかかっていた
  • 上限は1日50件

対応

オプションを追加して、招待メールも送信されないようにしたら、エラーがなくなった

const {
  CognitoIdentityProviderClient,
  AdminCreateUserCommand
} = require('@aws-sdk/client-cognito-identity-provider');

const cognitoIdentityProviderClient = new CognitoIdentityProviderClient({});

const params = {
UserPoolId: userPoolId,
Username: username,
UserAttributes: attributes,
MessageAction: 'SUPPRESS' // これを追加。メール送信されなくなる
};

await cognitoIdentityProviderClient.send(new AdminCreateUserCommand(params));
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?