[英]How can I access DynamoDB table from AccountA with using AccountB's User CLI credentials?
I have created one table in Dynamodb and setup role in IAM with following policy attached:我在 Dynamodb 中创建了一个表,并在 IAM 中设置了角色,并附加了以下策略:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "dynamodb:*",
"Resource": "arn:aws:dynamodb:ap-south-1:**AccountAID**:table/employee"
}]
}
I have added trusted entity AccountB ID in the role.我在角色中添加了可信实体 AccountB ID。 Then I have also created policy in AccountB for the access of dynamodb table created in AccountA with following policy:
然后我还在 AccountB 中创建了策略,用于访问在 AccountA 中创建的 dynamodb 表,其策略如下:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "*",
"Resource": "arn:aws:iam::**AccountAID**:role/DynamodbCrossAccountAccessRole"
}]
}
I have configured profiles of AccountA user and AccountB user and with the credentials of AccountA's profile user, I can list tables of dynamodb but while trying to get with AccountB's profile user I always returns with empty-table list.我已经配置了 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": [] }
Can anyone help me out of this why am I not able to access dynamodb with AccountB's profile?谁能帮我解决这个问题,为什么我无法使用 AccountB 的个人资料访问 dynamodb? Policies are attached to the account users respectively.
策略分别附加到帐户用户。
Based on the comments.根据评论。
The issue was solved by assuming the role in AccountB.通过担任 AccountB 中的角色解决了该问题。 The useful links showing how to do this are:
显示如何执行此操作的有用链接是:
Based on the comments and with the help of provided documents, I can access to my AccountB's resources.根据评论并在提供的文件的帮助下,我可以访问我的 AccountB 的资源。 I have configured generated API Key, Secret Key and Tokens in credentials file of my profile and it's working as expected.
我已经在我的个人资料的凭证文件中配置了生成的 API 密钥、密钥和令牌,并且它按预期工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.