Use GetIdentityPoolRoles with a CLI
The following code examples show how to use GetIdentityPoolRoles.
- CLI
-
- AWS CLI
-
To get identity pool roles
The following
get-identity-pool-rolesexample gets the roles for the specified identity pool.aws cognito-identity get-identity-pool-roles \ --identity-pool-id"us-west-2:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"Output:
{ "IdentityPoolId": "us-west-2:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Roles": { "authenticated": "arn:aws:iam::123456789012:role/Cognito_MyIdentityPoolAuth_Role", "unauthenticated": "arn:aws:iam::123456789012:role/Cognito_MyIdentityPoolUnauth_Role" } }For more information, see IAM roles
in the Amazon Cognito Developer Guide. -
For API details, see GetIdentityPoolRoles
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: Gets the information about roles for a specific Identity Pool.
Get-CGIIdentityPoolRole -IdentityPoolId us-east-1:0de2af35-2988-4d0b-b22d-EXAMPLEGUID1Output:
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-
For API details, see GetIdentityPoolRoles
in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: Gets the information about roles for a specific Identity Pool.
Get-CGIIdentityPoolRole -IdentityPoolId us-east-1:0de2af35-2988-4d0b-b22d-EXAMPLEGUID1Output:
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-
For API details, see GetIdentityPoolRoles
in AWS Tools for PowerShell Cmdlet Reference (V5).
-
For a complete list of AWS SDK developer guides and code examples, see Using this service with an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.