An application running on an Amazon EC2 instance in a development AWS account needs to securely access and read objects from an Amazon S3 bucket located in a separate production AWS account. The company's security policy strictly prohibits the use of long-term credentials and requires that all access logs identify the specific EC2 instance making the requests. Which combination of actions should a solutions architect recommend to meet these requirements? (Select TWO.)
- In the production account, create an IAM role with a trust policy that allows the development account's EC2 instance IAM role to assume it.Answer
- In the development account, attach an IAM policy to the EC2 instance's IAM role that grants the sts:AssumeRole permission for the production account's role.Answer
- CIn the production account, configure the S3 bucket policy to grant read access to the root user of the development account.
- DIn the development account, create an IAM user with API keys, and store the keys as plaintext parameters in Systems Manager Parameter Store.
- EIn the development account, manually create individual IAM users with long-term credentials for the EC2 instances to access the production bucket.
Answer
To securely access the S3 bucket in a separate account without long-term credentials, create an IAM role in the production account that trusts the development EC2 instance role, and grant the EC2 instance role permission to assume that production role.
The correct solution involves setting up cross-account access using an IAM role. In the production account, an IAM role is created with a trust policy that allows the IAM role attached to the EC2 instance in the development account to assume it. In the development account, the EC2 instance role is granted permission to perform the sts:AssumeRole action on the production role. This approach ensures access is secure, temporary, and easily auditable.
Step-by-Step Solution
Key Concept
Cross-account access using IAM roles and STS AssumeRole.