Repository navigation
Conversation
Package TarballHow to installgh release download pr-2720-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-1.0.1.tgz |
|
Claude Security Review: no high-confidence findings. (run) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2720 +/- ##
=========================================
Coverage 96.54% 96.54%
=========================================
Files 706 706
Lines 58529 58543 +14
=========================================
+ Hits 56508 56522 +14
Misses 2021 2021 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Changes requested
Base branch confirmed as refactor; reviewed against it. The schema change itself is well-shaped and matches the service contract (AWS::BedrockAgentCore::GatewayTarget IamCredentialProvider has a required Service and an optional Region that defaults to the gateway's region), and the tests use the real temp-project harness rather than fs mocks. One blocking problem, though: the CLI would start accepting a project spec that the pinned CDK library cannot deploy.
Blocking: pinned @aws/agentcore-cdk@1.0.0 rejects these specs, breaking agentcore deploy for the whole project
src/assets/cdk/package.json pins "@aws/agentcore-cdk": "1.0.0", and the vended app (src/assets/cdk/bin/cdk.ts) calls readAgentCoreProject, which validates agentcore.json against the library's own copy of the schema and throws ConfigValidationError on failure (dist/cdk/project/read-project.js). In the published 1.0.0 tarball that copy still has:
// dist/schema/schemas/mcp.js
openApiSchema: { authRequired: true, validAuthTypes: ['OAUTH', 'API_KEY'], iamRoleFallback: false },
mcpServer: { authRequired: false, validAuthTypes: ['OAUTH', 'NONE'], iamRoleFallback: false },
...
message: `${data.targetType} targets do not support ${authType} outbound auth`So a target written by this PR's new code path makes synth fail with "mcpServer targets do not support GATEWAY_IAM_ROLE outbound auth" — a message that directly contradicts the CLI validation that just accepted it, and the failure is at project-spec parse time, so it takes down deployment of every resource in the project, not just that one target.
Even if that validation were bypassed, the construct still can't honor the config: AgentCoreGateway.credentialProviders() only returns a provider for OAUTH/API_KEY and then falls back to iamRoleFallback (false for both of these target types), so:
addMcpServerTargetpassescredentialProviderConfigurations: []— the configured IAM signing is silently dropped;addApiSchemaTargetthrows "Target ... of type openApiSchema requires outbound auth (OAUTH or API_KEY)".
The cfnCredentialProvider() branch that actually emits iamCredentialProvider: { service, region } is only reached from addL1Target (passthrough / httpRuntime / apiGateway / connector).
This matches the PR description ("a companion AgentCore CDK change is still required") and the unchecked "dependent changes have been merged and published" box. Options:
- Land and publish the construct change first, then bump the pin in
src/assets/cdk/package.jsonto that version as part of this PR (preferred — keeps CLI acceptance and deployability in sync). - Hold this PR and merge it after the construct release lands.
- If the relaxation must land now, gate it so the CLI refuses the config (or at minimum warns loudly) when the project's pinned
@aws/agentcore-cdkversion predates support — otherwise users get an opaque synth failure for a config the CLI told them was valid.
Please also consider the upgrade path for already-vended projects, whose agentcore/cdk/package.json pins the older library independently of the CLI version.
Non-blocking note
IAM_SERVICE_AUTH_TARGET_TYPES (src/projectSchemas/gateway.ts:95) re-encodes information already in TARGET_TYPE_AUTH_CONFIG. If someone later adds GATEWAY_IAM_ROLE to another target type's validAuthTypes and forgets this list, the required-service check is skipped and synth emits an IamCredentialProvider without the CFN-required Service. Deriving it (TARGET_TYPE_AUTH_CONFIG[data.targetType].validAuthTypes.includes("GATEWAY_IAM_ROLE")) removes the drift risk and lets the list go away.
fa82ba4 to
b509345
Compare
|
Claude Security Review: no high-confidence findings. (run) |
|
Thanks—the deployment blocker is valid.
I updated the Testing section with these results. The PR remains a draft and the dependent-change checkbox remains unchecked until the CDK support is merged, published, and the CLI pin/upgrade path is handled. |
Description
Allow
GATEWAY_IAM_ROLEoutbound authentication formcpServerandopenApiSchemaproject Gateway targets.This change:
servicefor configured IAM role authentication while keepingregionoptional--target-configurationJSON/file input instead of adding--signing-serviceor--signing-regionflagsA companion AgentCore CDK change is still required to synthesize the configured IAM credential provider for these target types.
Related Issue
Part of #2245
Documentation PR
Not applicable. This uses the existing
--target-configurationinterface and introduces no new CLI flags.Type of Change
Testing
How have you tested the change?
bun test— 4,702 passed, 6 skipped, 0 failedus-west-2--target-configuration@aws/agentcore-cdk@1.0.0READY403, while AgentCore completed IAM-signed tool discoverybun run typecheckbun run lint:checkbun run format:checkbun run buildsrc/assets/, I updated affected snapshots withbun test <test-file> --update-snapshotsand committed them —src/assets/was not modifiedChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.