问题
i am trying to get user details from cognito based on sub id, below is code for the same(Filter="sub ="XXXXX-dCCa-4121-94c9-XXXXXX""), now i want to pass the variable in filter , tried with below format but its not working, what is the exact format to pass variable in filter,
code : import boto3
client = boto3.client('cognito-idp',region_name='us-east-2',
aws_access_key_id='XXXXXX',
aws_secret_access_key='XXXXXXX',
)
id='XXXXX-dCCa-4121-94c9-XXXXXX'
response1 = client.list_users(UserPoolId='us-east-2_XXXXXX',AttributesToGet=
['birthdate','name','sub'], Filter="sub = \"" + id + "\"")
print(response1)
来源:https://stackoverflow.com/questions/62663272/variable-format-for-filter-in-cognito