aws身份池过滤器在多个条件下列出用户api

Mat*_*ain 5 amazon-web-services amazon-cognito boto3 aws-userpools

有没有办法在多个条件下过滤列表用户 api 的结果。我想从列表中获取具有用户名的所有用户的列表

import boto3
client = boto3.client('cognito-idp')
client.list_users(UserPoolId='us-east-1_123456789', AttributesToGet=['email'], Filter="username =\"user_name_1\"")
Run Code Online (Sandbox Code Playgroud)

上面的代码只返回我一个用户名。现在,如果我想获取多个用户名的相同信息,我似乎找不到方法来做到这一点。

前任:

import boto3
usernames=['user_id1','user_id2']
client = boto3.client('cognito-idp')
client.list_users(UserPoolId='us-east-1_123456789', AttributesToGet=['email'], Filter="username =usernames")
Run Code Online (Sandbox Code Playgroud)

tho*_*ace 6

不幸的是不是:https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ListUsers.html#API_ListUsers_RequestSyntax

您只能按严格相等或开头进行过滤;没有通配符或数组。

也就是说,ListUsers似乎没有特定的 api 调用限制,因此您可以快速连续地多次调用它,直到处理完所有用户名为止。

  • 它的软限制为 [每秒 5 个请求](https://docs.aws.amazon.com/cognito/latest/developerguide/limits.html) (3认同)