从 Javascript sdk 访问 AWS Athena

AWS Athena access from Javascript sdk

我正在尝试使用未经授权的 Cognito IAM 角色从 Javascript SDK 连接 Athena,但我收到 AccessDenied 异常。通过相同的设置,我可以访问 S3 和 dynamodb。 我已经为 S3 和 Athena 提供了池角色的权限以进行未授权访问。

Error: User: arn:aws:sts::11xxxxxxxxx:assumed-role/Cognito_Pool1Unauth_Role/CognitoIdentityCredentials is not authorized to perform: athena:StartQueryExecution

// A lot of useless lines

at constructor.callListeners (aws-sdk.min.js:2) "AccessDeniedException: User: arn:aws:sts::11xxxxxxxxx:assumed-role/Cognito_Pool1Unauth_Role/CognitoIdentityCredentials is not authorized to perform: athena:StartQueryExecution

我们是否无法使用 Cognito Unauthorized Pool Id 从 Javascript 连接 Athena?我认为我们应该能够。还有其他需要我们做的设置吗?

通过 JS sdk 映射的角色似乎有问题。对于 Dynamo 和其他服务,它运行良好。通过指定具有权限的角色,它可以工作。