将 SetIdentityPoolRoles 与 CLI 配合使用 - Amazon Cognito

SetIdentityPoolRoles 与 CLI 配合使用

以下代码示例演示如何使用 SetIdentityPoolRoles

CLI
AWS CLI

设置身份池角色

以下 set-identity-pool-roles 示例设置身份池角色。

aws cognito-identity set-identity-pool-roles \ --identity-pool-id "us-west-2:11111111-1111-1111-1111-111111111111" \ --roles authenticated="arn:aws:iam::111111111111:role/Cognito_MyIdentityPoolAuth_Role"
PowerShell
Tools for PowerShell V4

示例 1:将特定的身份池配置为具有未经身份验证的 IAM 角色。

Set-CGIIdentityPoolRole -IdentityPoolId us-east-1:0de2af35-2988-4d0b-b22d-EXAMPLEGUID1 -Role @{ "unauthenticated" = "arn:aws:iam::123456789012:role/CommonTests1Role" }
  • 有关 API 的详细信息,请参阅《AWS Tools for PowerShell Cmdlet 参考(V4)》中的 SetIdentityPoolRoles

Tools for PowerShell V5

示例 1:将特定的身份池配置为具有未经身份验证的 IAM 角色。

Set-CGIIdentityPoolRole -IdentityPoolId us-east-1:0de2af35-2988-4d0b-b22d-EXAMPLEGUID1 -Role @{ "unauthenticated" = "arn:aws:iam::123456789012:role/CommonTests1Role" }
  • 有关 API 的详细信息,请参阅《AWS Tools for PowerShell Cmdlet 参考(V5)》中的 SetIdentityPoolRoles

有关 AWS SDK 开发人员指南和代码示例的完整列表,请参阅 将此服务与 AWS 开发工具包结合使用。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。