Repository navigation
fix(cdk): honor Bedrock geography in MicroVM grants (#955) - #960
proton0210 wants to merge 2 commits into
Conversation
Resolve the configured geography so the fallback compute-role grants match the inference profiles delivered to the agent. Cover global, eu, explicit us, and omitted context in synthesis regressions. Fixes aws-samples#955 Co-Authored-By: Codex <codex@openai.com>
|
We measured this PR at What we checked
Impact On MicroVM, Claude Code signs Bedrock calls with whatever We ran the shipped helper with the pinned CLI (2.1.301 from
So on
This failure is pre-existing on Doc lines
— drafted by Bonk |
Address review feedback on aws-samples#960. Refs aws-samples#955. Co-Authored-By: Codex <codex@openai.com>
|
@laithalsaadoon Thanks for the detailed validation. Addressed the documentation feedback in df5fb39: both comments in I also corrected the PR description to scope the impact to persistent ambient-credential fallback and linked your findings about the pre-existing ECS asset-hash test failure. The issue body remains for its author/maintainers to update. Validation for this follow-up: CDK ESLint and Could you please take another look at the updated PR? It remains a draft pending the maintainer approval required for #955. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #960 +/- ##
=======================================
Coverage ? 92.60%
=======================================
Files ? 353
Lines ? 101994
Branches ? 11620
=======================================
Hits ? 94453
Misses ? 7541
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Lambda MicroVM execution roles grant
us.*inference profiles even when the deployment invokesglobal.*oreu.*. Normal task calls use the per-task SessionRole, whose grants already followbedrockGeoRegion. The mismatch causesAccessDeniedwhen the credentials helper falls back to the compute role and that fallback persists beyond a retry. ResolvebedrockGeoRegionwith the shared resolver and build each profile ID withinferenceProfileId, restoring the documented ambient-credential fallback.Area
cdk— infrastructure, handlers, constructsagent— Python runtime / Docker imagecli—bgagentclientdocs— guides or design sources (docs/guides/,docs/design/)tooling— rootmise.toml, scripts, CI workflowsRelated
Fixes #955. Implements the scope proposed in the issue comment.
Changes
Use the shared geography resolver and inference-profile helper for the MicroVM execution-role grants.
Add synthesis regressions for
global,eu, explicitus, and omitted context. Assert the account/Region-scoped profile ARNs, bare foundation-model ARNs, unchanged invoke actions and resource count, and absence of staleus.*profiles for non-US geographies.Update both shared-model documentation comments to describe all three grant sites, including the MicroVM execution role.
Validation
globalandeufail as expected; explicit and defaultuspass.mise run build: agent quality (1,800 tests), CLI (1,079 tests), docs, drift checks, CDK compilation/lint, and bundled synthesis pass. CDK reports 5,767 passing tests and one failure in the existing ECS network-extraction comparison (test/stacks/network.test.ts:307), where Docker asset hashes differ between two templates. After the full build finishes, an isolated rerun of that ECS group passes all 10 tests. The full parallel build is therefore not reported as green.Independent reviewer validation confirms the fix across eight geography configurations and three backends, including live sandbox checks of the fallback permissions. The reviewer also reproduced the ECS asset-hash failure on pristine
mainand traced it to.jest-cacheinside the Docker build context. These independent results are separate from the local validation above.Three audit passes covered configuration propagation, synthesized IAM scope/default behavior, and the final diff and regression evidence. No live AWS deployment was performed.
Approval status
Draft while #955 awaits a permitted maintainer's
approvedlabel and assignment under ADR-003.Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.