Course menuDVA-C03

Exams / DVA-C03 / AI service access and data privacy / Question 3

DVA-C03 practice question: AI service access and data privacy (3 of 3)

Security A free question from our original DVA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A telecom company builds a customer-support agent with Amazon Bedrock Agents. An action group uses an AWS Lambda function to look up a customer's plan, and the developer created the function and the action group with the AWS CLI.

When the agent tries to use the action group, the call to the function is denied. The function must be callable only by this agent, not by other agents or accounts.

Which change meets these requirements?

Choose one answer.

  1. A. Add lambda:InvokeFunction on the function's ARN to the agent's service role, and leave the function's resource-based policy without any statements.
  2. B. Add a resource-based policy statement that allows the bedrock.amazonaws.com service principal to invoke the function, with no conditions on the request.
  3. C. Add a resource-based policy that lets bedrock.amazonaws.com invoke the function, conditioned on aws:SourceAccount and on aws:SourceArn matching this agent's ARN.
  4. D. Give the Lambda function's execution role permission to call bedrock:InvokeAgent, so that the function and the agent trust each other.
Show the answer and explanation

Answer: C

  • A. Wrong: Bedrock calls an action group function as the bedrock.amazonaws.com service, so the function's resource-based policy must allow it. An identity policy on the service role does not grant that.
  • B. Wrong: This clears the error, but any Bedrock agent in any account could then invoke the function. That breaks the requirement that only this agent may call it.
  • C. Right: Correct. Action group functions need a resource-based policy that allows Bedrock to invoke them. The source account and source ARN conditions limit that permission to this one agent, which also prevents the confused deputy problem. Learn more: Create a service role for Amazon Bedrock Agents (opens in a new tab)
  • D. Wrong: The execution role controls what the function's code can call. It does not decide who may invoke the function, so the agent is still denied.

Explanation

Amazon Bedrock Agents invokes an action group's Lambda function as the bedrock.amazonaws.com service principal, so the function needs a resource-based policy that allows it. Adding aws:SourceAccount and aws:SourceArn conditions for the agent's ARN limits the permission to that one agent. Identity policies on the agent's role or the function's role do not grant permission to invoke the function.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on AI service access and data privacy? The 5 full-length practice sets have 11 more AI service access and data privacy questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets