Fixing AccessDenied on Bedrock Automated Model Evaluation Jobs
A company is implementing a 2-week initiative to incorporate GenAI into several hundred existing applications to provide context-driven natural language help for users. To simplify the process to choose an appropriate model for each application, a GenAI Developer is building a system to automatically compare foundation models (FMs) based on general text generation accuracy. The system runs a job that performs a series of steps. First, the system creates a service role and attaches an IAM permissions policy that allows Amazon Bedrock to invoke the FMs and grants access to Amazon S3. Then the system requests and receives access to all the FMs that need to be tested. Then the system creates S3 buckets to store the evaluation results. Then the system creates evaluation configurations by using the TREX built-in dataset. Finally, the system specifies the Accuracy metric and Generation evaluation type in each evaluation configuration. When the GenAI developer attempts to run the system, it fails with an AccessDenied exception. The GenAI developer must resolve the issue. Which solution will meet this requirement?
Community Insight
The question tests whether you recognize that an IAM role for a Bedrock automated model evaluation job needs BOTH an identity-based permissions policy and a trust (assume-role) policy — the classic trap is to blame the dataset choice, the metric configuration, or S3 CORS for what is purely an sts:AssumeRole failure.
Amazon Bedrock automated model evaluation jobs require an IAM service role carrying both an inline permissions policy (Bedrock model invocation plus S3 access) and a trust policy that lets the Bedrock evaluation service assume the role. Because the developer created only the permissions half, the job's AssumeRole call is rejected, and the AccessDenied exception is resolved by attaching a trust policy naming bedrock.amazonaws.com as the service principal (option A).
Learners most often pick C or D, reasoning that TREX is incompatible with the Accuracy/Generation pairing and that Gigaword with Summarization/Correctness would validate correctly. A mismatched dataset or metric produces a validation or evaluation-configuration error, not an AccessDenied exception raised before the job can even assume its role. Option B is also a common wrong pick because S3 appears in the permissions policy, but CORS governs browser-based requests, not IAM authorization.
Community Discussion (1 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
An IAM role is defined by two separate policy documents: the permissions (identity-based) policy and the trust policy returned by the same CreateRole call. The developer explicitly attached the permissions policy allowing Bedrock to invoke the FMs and to reach S3, but the narrative never mentions defining who may assume the role. When the automated model evaluation job starts, the Bedrock service calls sts:AssumeRole on the service role; without a trust relationship permitting the bedrock.amazonaws.com service principal, that call is denied and surfaces as an AccessDenied exception. Option A supplies exactly the missing half — a trust policy that defines Amazon Bedrock as the service principal — which is the documented requirement for model evaluation jobs, RAG flows, and any other Bedrock feature that runs under a customer-supplied service role.
Why the Other Options Are Wrong
Option B addresses CORS, which is a browser-side HTTP header mechanism controlling whether web origins may read S3 responses; it has no bearing on server-side IAM authorization for a job that reads and writes buckets through the AWS SDK, and it would never generate an AccessDenied from role assumption. Option C swaps the built-in TREX dataset for Gigaword, but both are supported AWS-managed evaluation datasets; a dataset problem would raise an invalid-argument or validation error and would not prevent the role from being assumed at the start of the job. Option D changes the evaluation type to Summarization with a Correctness metric, which is a legitimate configuration for summarization workloads, yet configuration changes cannot fix a permissions failure that occurs before any FM is invoked. Both C and D also distract from the stated goal of comparing general text generation accuracy, which the Accuracy/Generation pairing already expresses correctly.
Community Comment Notes
The single community comment reaches the same conclusion, explaining that an identity-based service role for Bedrock automated model evaluation "requires two types of policies" — a permissions policy, which the developer "already attached," and a trust policy defining "who is allowed to assume" the role. That reasoning matches AWS's documented model evaluation job setup, where the execution role must trust bedrock.amazonaws.com so the service can invoke models and write results to S3 on the customer's behalf.
Official Reference
Exam Strategy
In Bedrock scenario questions, an AccessDenied or role-assumption failure almost always points to the trust policy rather than to models, datasets, metrics, or S3 CORS. Verify first that the service role trusts the correct service principal (here bedrock.amazonaws.com), then check the permissions policy for the specific actions involved.
Frequently Asked Questions
Why doesn't changing the TREX dataset or the Accuracy metric fix an AccessDenied exception?
AccessDenied occurs when sts:AssumeRole is refused, before any dataset or FM is used. Dataset and metric mismatches raise validation errors instead, so only the missing trust policy (A) resolves it.
How is CORS different from the IAM permissions policy on the S3 buckets?
CORS is a set of XML rules on the bucket controlling which browser origins may issue HTTP requests; IAM policies govern AWS API authorization. A Bedrock evaluation job uses the SDK, so CORS (B) is irrelevant.
Related Analysis
Practice All AIP-C01 Questions
Access 110 questions with complete answers and detailed explanations.
View Full AIP-C01 Practice Test →