A developer is running an application on an Amazon EC2 instance in Account . The EC2 instance is associated with an IAM instance profile that uses a role named `EC2InstanceRole`. The application needs to perform temporary tasks by assuming an IAM role named `DataProcessorRole` in the same account.
The developer runs a script on the instance using the AWS SDK to assume `DataProcessorRole`, but the operation fails with an `AccessDenied` error.
The trust policy of `DataProcessorRole` is currently configured as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Which of the following configuration changes must the developer make to resolve this issue? (Select TWO.)
- Update the trust policy of `DataProcessorRole` to specify the ARN of `EC2InstanceRole` as the Principal.Answer
- Attach an IAM permissions policy to `EC2InstanceRole` that allows the `sts:AssumeRole` action on `arn:aws:iam::123456789012:role/DataProcessorRole`.Answer
- CUpdate the trust policy of `EC2InstanceRole` to define `DataProcessorRole` as a trusted Principal.
- DAttach an IAM permissions policy to `DataProcessorRole` that allows the `sts:AssumeRole` action on all resources (`*`).
- EModify the application script to hardcode the AWS access key and secret access key of a high-privilege IAM user.