amazon-web-services - 如何使用 AccountB 的用户 CLI 凭证从 AccountA 访问 DynamoDB 表?
问题描述
我在 Dynamodb 中创建了一个表,并在 IAM 中设置了角色,并附加了以下策略:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "dynamodb:*",
"Resource": "arn:aws:dynamodb:ap-south-1:**AccountAID**:table/employee"
}]
}
我在角色中添加了可信实体 AccountB ID。然后我还在 AccountB 中创建了策略,用于访问在 AccountA 中创建的 dynamodb 表,其策略如下:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "*",
"Resource": "arn:aws:iam::**AccountAID**:role/DynamodbCrossAccountAccessRole"
}]
}
我已经配置了 AccountA 用户和 AccountB 用户的配置文件,并且使用 AccountA 的配置文件用户的凭据,我可以列出 dynamodb 的表,但是在尝试使用 AccountB 的配置文件用户时,我总是返回空表列表。
Krunal-MacBook-Air:.aws krunal$ aws dynamodb list-tables --profile Krunal { "TableNames": [ "employee" ] } Krunal-MacBook-Air:.aws krunal$ aws dynamodb list-tables --profile Krunal2 { "TableNames": [] }
谁能帮我解决这个问题,为什么我无法使用 AccountB 的个人资料访问 dynamodb?策略分别附加到帐户用户。
解决方案
根据评论。
通过担任 AccountB 中的角色解决了该问题。显示如何执行此操作的有用链接是:
推荐阅读
- csv - Spark:没有输入文件名
- arrays - 将下采样图像映射到原始分辨率 - MATLAB
- sql-server - 限制每组中只有一个标记为主要的记录
- javascript - Jquery兄弟姐妹在警报中显示未定义
- symfony - Symfony 3.4/doctrine2:在分离的对象中获取实体原始数据以进行比较
- tensorflow - 无法在 Windows 上安装 tensorflow
- c++ - QtCreator 中用于 C++ 类型的自动完成
- javascript - How to resume the submit request that was blocked by event.preventDefault(); when the function is executed
- python - Python Dash 嵌套 html ul 列表
- ios - 如何在 UISearchBar 中保存选定的范围按钮?