Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the format of user pool id for AWS CognitoIdentity?

I need to get a list of users in my Cognito pool using AWS javascript SDK. I was going to use CognitoIdentity class and the following method to get user list:

var params = {
  IdentityPoolId: 'STRING_VALUE', /* required */
  ...
};
cognitoidentity.listIdentities(params, function(err, data) {
  ...
});

However, it requires IdentityPoolId in a very strange format:

An identity pool ID in the format REGION:GUID.

The check for which looks like:

[\w-]+:[0-9a-f-]+

That is, region name should be without numbers. However, most of the regions have numbers, for example, my region is "ap-northeast-1". Both Pool Id and Pool ARN values don't match. What is the real format of this id and where to get the value for my user pool?

like image 639
Arsenii Fomin Avatar asked Sep 16 '25 23:09

Arsenii Fomin


1 Answers

The example of the IdentityPoolId is provided in the API documentation for ListIdentities:

An identity pool ID in the format REGION:GUID.

Pattern: [\w-]+:[0-9a-f-]+

Example given:

"IdentityPoolId": "us-east-1:509f9747-5b5d-484e-a2d7-74fcba108147"
like image 124
Marcin Avatar answered Sep 19 '25 21:09

Marcin