Community contribution: finale AgentCore region and permissions fix - #163
Community contribution: finale AgentCore region and permissions fix#163prodm93 wants to merge 1 commit into
Conversation
… for finale Documents three issues with the finale project when deploying from a non-us-west-2 region: inference profile ARN mismatch, missing code interpreter IAM permissions, and IAM execution role vs user permission confusion. Includes patched first.py and looper.py with explicit model inference profile IDs and region settings.
|
thank you so much for this! But are you sure I should add those finale/ files? |
|
Hi Ed! These files contain the actual fixes required to make the finale code run. The original versions rely on Strands’ implicit model and region defaults, which no longer seem to work with the model setup currently available through Bedrock. The changes explicitly select working inference profiles and keep the model, runtime, and Code Interpreter in the same region, preventing the failures described in the PR. Not the prettiest workaround at the IAM permissions resolution level, but it does sort out the issues just fine and keep the project working when it wasn't possible to do with the original finale code/setup. I did see that the finale generally lets students copy and paste chunks from the README.md to reconstruct the code themselves--were you hoping to have the PR restructured that way rather than have complete files? |
Summary
The finale project breaks out of the box for anyone whose default AWS region is not
us-west-2. The default model (Claude Sonnet 4) has also been sunset, so the course's default Agent() configuration no longer works reliably without explicitly configuring a supported model and inference profile.This PR adds a community contribution guide that walks through the full fix: deploying in
us-west-2, switching to a working model with explicit inference profile IDs, and patching the auto-generated IAM role for code interpreter permissions. It also includes patchedfirst.pyandlooper.pythat work against a currentus-west-2deployment with Nova Pro.The guide briefly covers open-source model selection to cirucmvent needing to sign a usage agreement for Anthropic models as well: Nova Micro is not reliable enough for multi-step tool use and emits literal
<thinking>tags into output; LLaMA models are incompatible with streaming entirely. Nova Pro is the recommended alternative.Files changed
community_contributions/finale_agentcore_region_and_permissions_fix.md: step-by-step guide covering region setup, model and inference profile configuration, IAM permissions for code interpreter, model choice notes, and links to relevant AWS and Strands docsfinale/first.py: patched with explicitBedrockModelusingus.amazon.nova-pro-v1:0andus-west-2finale/looper.py: same model fix; workingexecute_pythontool withCodeInterpreter("us-west-2")