Skip to main content
AWS managed policies are intentionally broad and general-purpose. For production workloads, favor custom IAM policies that precisely state which actions are allowed and which specific resources they apply to.
Use the principle of least privilege: grant only the actions and resources an application truly needs. Prefer explicit denies for high-risk or unapproved operations to provide an additional safety net.
Below is a compact, real-world example that lets a principal invoke a single foundation model and use a specific knowledge base for retrieval-augmented generation (RAG):
Author these policies in the IAM JSON editor or via IaC to apply fine-grained restrictions. Examples and guidance
  1. Allowing InvokeModel with a wildcard resource (not recommended)
This policy grants the ability to invoke any Bedrock model and supports response streaming (partial output as the model generates it). Using "Resource": "*" grants broad access and violates least privilege.
Best practice: scope policies to the specific model ARNs required by each application—for example, amazon.nova-micro-v1 for App 1 and anthropic.claude-* variants for App 2.
  1. Deny high-cost models and allow approved models only
Explicitly deny high-cost models and then allow only approved models. A deny statement here prevents escalation if another attached policy accidentally grants broader access.
  1. Deny Bedrock outside approved regions (using a condition)
Enforce regional restrictions with a deny plus condition. Deny statements combined with conditions are an effective mechanism for organization-wide constraints.
Explanation: StringNotEquals on aws:RequestedRegion makes the deny apply when the requested region is not in the approved set.
  1. Allow RetrieveAndGenerate for a specific knowledge base, deny KB management
Allow runtime RAG against a single knowledge base, and explicitly deny knowledge-base management actions (create/update/delete). This prevents accidental or malicious changes even if other policies are permissive.
  1. Deny direct Bedrock invocation entirely
For principals that should never interact with Bedrock, attach a deny policy that blocks invocation and RAG operations across the board.
  1. Allow runtime use of a guardrail but deny guardrail administration
Guardrails moderate or filter model usage at runtime. This pattern allows using a specific guardrail but prevents modifying or deleting it.
Quick reference table Outcome and operational benefits
  • Controlled, governed model usage: applications can only call the models and KBs you authorize.
  • Reduced blast radius from compromised principals: scoped allows and explicit denies limit what an attacker can do.
  • Enforced safety and compliance: conditions and guardrail controls enable centralized protections that applications cannot bypass.
A presentation slide with a dark left panel labeled "Key Takeaway." On the right, a small blue callout numbered "01" contains the text "IAM controls not just access to Bedrock, but how it is used."
IAM controls more than whether a principal can reach Bedrock: it governs which foundation model(s) they can call, in which region(s) they may operate, whether they can access knowledge bases, and which administrative actions are permitted or denied. Use narrow Allow statements to grant necessary capabilities and Deny statements where you need absolute restrictions. This concludes the lesson on using IAM to control access to Amazon Bedrock. For hands-on validation, run lab exercises that attempt operations your policies allow or deny—this is the most reliable way to confirm your configuration.
A presentation slide titled "What's Next? Implementing restricted access with IAM (LAB)". On the right is a teal circular icon showing a stylized brain with circuit lines against a dark curved background.
Use lab exercises to attempt operations that your policies allow or deny to validate your configuration. Links and references

Watch Video

Practice Lab