fix: sync e2e IAM policy and fix run eval flag#1092
Conversation
… HTTP gateways - Add ConfigBundleManagement: CreateConfigurationBundle and related CRUD actions needed by post-deploy-config-bundles.ts - Add HttpGatewayIamRoleManagement: iam:CreateRole/DeleteRole/GetRole/ PutRolePolicy/DeleteRolePolicy scoped to arn:aws:iam::*:role/AgentCore-* needed by post-deploy-http-gateways.ts to create execution roles Without these, config-bundle-eval-rec.test.ts and ab-test-target-based.test.ts fail in CI with 403 authorization errors. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for adding these. I found two IAM actions that look missing for the HTTP gateway flow — without them the e2e test will still hit AccessDenied in the same 1. Missing
|
Coverage Report
|
IAM policy (docs/policies/iam-policy-user.json): - Add BatchEvalAndRecommendation: StartBatchEvaluation, StartRecommendation and related Get/List actions (already had ConfigBundle and HttpGateway IAM) Test fix (e2e-tests/config-bundle-eval-rec.test.ts): - run eval uses --days not --lookback; fix the flag name Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Bring the documented policy fully in sync with what is deployed on the e2e-github-actions role. Adds actions that were missing from the docs: - InvokeAgentRuntimeForUser, InvokeAgentRuntimeCommand, InvokeModelWithResponseStream - DeleteApiKeyCredentialProvider, ListApiKeyCredentialProviders - Full AgentCore resource management (CreateAgentRuntime, gateways, memories, etc.) - cloudformation:*, ssm:GetParameter(s), cloudformation:GetTemplate - secretsmanager CRUD, cognito-idp for custom JWT e2e setup - HarnessManagement + HarnessPassRole - Kept ACCOUNT_ID placeholder for account-specific resources Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
CreateRoleCommand passes Tags so iam:TagRole is required. After creation, the role ARN is passed to createHttpGateway() which requires iam:PassRole on the caller. Both scoped to AgentCore-* resource. Caught by agentcore-cli-automation review on PR #1092. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Summary
docs/policies/iam-policy-user.jsonfully with the livee2e-github-actionsrole — the doc was significantly out of datebedrock-agentcore:CreateConfigurationBundle+ CRUD (fixesconfig-bundle-eval-rec.test.ts403s)iam:CreateRole/DeleteRole/GetRole/PutRolePolicy/DeleteRolePolicyscoped toAgentCore-*(fixes HTTP gateway role creation inab-test-target-based.test.ts)bedrock-agentcore:StartBatchEvaluation,StartRecommendation+ related Get/List actions (fixes 403s in batch eval and recommendation tests)run evalCLI flag: test was passing--lookbackbut the correct flag is--daysRoot cause
Several new post-deploy operations (config bundle sync, HTTP gateway IAM role creation, batch evaluation, recommendations) were added without updating the e2e role policy or the docs. The doc had also drifted significantly from the live role.
Test plan
config-bundle-eval-rec.test.ts— deploy warnings and 403s should clearab-test-target-based.test.ts— HTTP gateway creation should succeedrun evaltest step —--daysflag resolves theunknown optionerror🤖 Generated with Claude Code