A developer is configuring a Python application running on an Amazon EC2 instance in Account A () to retrieve files from a private Amazon S3 bucket located in Account B (). The EC2 instance is associated with an IAM instance profile utilizing a role named `EC2ReadRole`. The developer creates an IAM role named `S3AccessRole` in Account B. However, when the application attempts to assume the role, it receives an `AccessDenied` error. The trust policy for `S3AccessRole` in Account B is currently configured as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111122223333:role/EC2ReadRole"
},
"Action": "sts:AssumeRole"
}
]
}
Which two configuration steps must the developer perform to successfully establish this cross-account access and resolve the `AccessDenied` error? (Select TWO.)
- Attach a permissions policy to the EC2ReadRole in Account A that allows the sts:AssumeRole action on the arn:aws:iam::444455556666:role/S3AccessRole resource.Cevap
- Attach a permissions policy to the S3AccessRole in Account B that allows the s3:GetObject action on the target S3 bucket resource.Cevap
- CAdd a statement to the S3AccessRole permissions policy in Account B that allows the sts:AssumeRole action targeting the EC2ReadRole ARN.
- DModify the S3 bucket policy in Account B to allow the sts:AssumeRole action for the EC2ReadRole ARN.
- EModify the application code on the EC2 instance to initialize the AWS SDK client with hardcoded AWS access keys of an IAM user from Account B.