概要
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)