Use GetIdentityPoolRoles with an AWS SDK or CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use GetIdentityPoolRoles with an AWS SDK or CLI

The following code examples show how to use GetIdentityPoolRoles.

CLI
AWS CLI

To get identity pool roles

This example gets identity pool roles.

Command:

aws cognito-identity get-identity-pool-roles --identity-pool-id "us-west-2:11111111-1111-1111-1111-111111111111"

Output:

{ "IdentityPoolId": "us-west-2:11111111-1111-1111-1111-111111111111", "Roles": { "authenticated": "arn:aws:iam::111111111111:role/Cognito_MyIdentityPoolAuth_Role", "unauthenticated": "arn:aws:iam::111111111111:role/Cognito_MyIdentityPoolUnauth_Role" } }
PowerShell
Tools for PowerShell

Example 1: Gets the information about roles for a specific Identity Pool.

Get-CGIIdentityPoolRole -IdentityPoolId us-east-1:0de2af35-2988-4d0b-b22d-EXAMPLEGUID1

Output:

LoggedAt : 8/12/2015 4:33:51 PM IdentityPoolId : us-east-1:0de2af35-2988-4d0b-b22d-EXAMPLEGUID1 Roles : {[unauthenticated, arn:aws:iam::123456789012:role/CommonTests1Role]} ResponseMetadata : Amazon.Runtime.ResponseMetadata ContentLength : 165 HttpStatusCode : OK