Soru

Zorluk: OrtaIdentity and Access Management (IAM)

A company has an application running on Amazon EC2 instances in AWS Account A (Development) that requires read-only access to an Amazon DynamoDB table located in AWS Account B (Production). According to security best practices, the application must not store long-term credentials on the EC2 instances. Which combination of actions should the solutions architect take to configure this access securely? (Select TWO.)

  1. Create an IAM role in Account B with a trust policy that allows Account A to assume the role, and attach a permissions policy that grants read-only access to the DynamoDB table.Cevap
  2. Configure an IAM role in Account A, attach it to the EC2 instances as an instance profile, and authorize the role to perform the sts:AssumeRole action on the Account B role.Cevap
  3. C
    Create access keys for the AWS account root user of Account B, and configure the application to retrieve them using instance metadata.
  4. D
    Create an IAM user in Account B, and configure the application to retrieve the user's access keys from a plaintext Systems Manager Parameter Store parameter of type String.
  5. E
    Create individual IAM users in Account B for the EC2 instances in Account A to use for federated access to the DynamoDB table.

Cevap

Create an IAM role in Account B with a trust policy that allows Account A to assume the role, and configure an IAM role in Account A attached to the EC2 instances to authorize the sts:AssumeRole action on the Account B role.
The correct architecture uses cross-account role delegation. A role in Account B defines a trust relationship allowing Account A to assume it and carries the permission to read the DynamoDB table. The EC2 instances in Account A are assigned an instance profile with an IAM role that permits calling the sts:AssumeRole API on the role in Account B. This removes the need for long-term credentials on the instances.

Adım Adım Çözüm

1
Define cross-account access trust in the target account
An IAM role is created in Account B with a trust policy allowing Account A to assume it, and a permission policy granting DynamoDB read permissions.
This establishes the target permissions and delegates trust to the source account.
2
Grant the EC2 instances permission to assume the cross-account role
An IAM role is created in Account A, attached as an EC2 instance profile, with policies allowing sts:AssumeRole on the role in Account B.
This enables the EC2 instances to dynamically request temporary credentials from STS for Account B.

Anahtar Kavram

Cross-account IAM role assumption and delegate trust pattern
Tahmini Süre:2m 0s
Bu soruyu puanla