Topic 1 Question 376
A company has a multi-account environment. Account A has a production application that is hosted on an Amazon EC2 instance. The application needs to query data in an Amazon DynamoDB table that is hosted in Account B.
A SysOps administrator needs to provide the EC2 instance in Account A with access to the DynamoDB table in Account B.
What is the MOST secure solution that will meet these requirements?
Update the IAM policy that is attached to the EC2 instance's IAM role to allow the dynamodb:Query permission on the DynamoDB table in Account B. Add a policy in Account A to allow the DynamoDB service principal to use the PassRole action to pass the role to Account B.
In Account B, create an IAM role that has permission to query the DynamoDB table. Add the EC2 instance's IAM role to the trust policy on the newly created IAM role in Account Update the IAM policy that is attached to the EC2 instance's IAM role to allow the sts:AssumeRole permission on the newly created IAM role in Account B.
Update the IAM policy that is attached to the EC2 instance's IAM role to allow the dynamodb:Query permission on the DynamoDB table in Account B. Update the DynamoDB table's resource policy to allow the query action from the EC2 instance's IAM role.
In Account B, create a static IAM key that has the appropriate permissions to query the DynamoDB table. Embed these credentials into the credentials file on the EC2 instance. Reference the credentials every time the application needs to query the table.
ユーザの投票
コメント(4)
Answer is B. According to https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/configure-cross-account-access-to-amazon-dynamodb.html
You should create a role in account B that has permission to query the DynamoDB table. For Select trusted entity, choose account A. Then create a policy in account A to access Account B.
👍 1Tapkar2023/08/24- 正解だと思う選択肢: B
Looks like correct answer is B.
Here is an example with lambda: https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/configure-cross-account-access-to-amazon-dynamodb.html
And I couldn't find resource policy on dynamoDB.
👍 1xSohox2023/08/25 - 正解だと思う選択肢: B
Option B describes the most secure solution for granting the EC2 instance in Account A access to the DynamoDB table in Account B:
👍 1AWSdeveloper082023/08/25
シャッフルモード