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?

More than 1 year has passed since last update.

CognitoのTooManyRequestsException対策

Posted at

概要

Cognitoのlist_userには時間当たりの実行回数に制限があり、超えると
TooManyRequestsExceptionが発生する。

対策

configでretry処理を追加する。
modeはstandardを指定する必要がある。
legacyではTooManyRequestsExceptionには対応していない。

cognito_config.py
import boto3
from botocore.config import Config

config = Config(
   retries = {
      'max_attempts': 10,
      'mode': 'standard'
   }
)

cognito_client = boto3.client('cognito-idp', config=config)

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?