fix: CDK template types and credential ARN passthrough for gateway deploy#432
Merged
jesseturner21 merged 8 commits intoaws:feat/gateway-integrationfrom Feb 26, 2026
Conversation
The CDK stack template used McpSpec (doesn't exist) instead of AgentCoreMcpSpec, and passed wrong prop names to AgentCoreMcp: - spec → mcpSpec - application → agentCoreApplication - Added missing projectName prop
…re CDK synth API key credential providers were created during deploy but their ARNs were not stored in deployed state, causing CDK to fail with 'Credential not found in deployed state' for gateway targets with API key auth. - Return credentialProviderArn from create/update API key providers - Unify API key and OAuth credential ARNs into single deployed state map - Move credential setup before CDK synth so template can read ARNs - Write partial deployed state with credentials before synth
CDK template now reads deployed-state.json and extracts credential provider ARNs per target, passing them to AgentCoreMcp so gateway targets can reference outbound auth credentials.
4894ebe to
8f65e67
Compare
da3a2b4
into
aws:feat/gateway-integration
12 of 16 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes CDK template types, credential handling, and deploy flow ordering for gateway target deployment.
CDK template type mismatches (
1ee255f)McpSpec→AgentCoreMcpSpec(type was renamed in CDK package)McpDeployedState— no longer exists in CDK packageAgentCoreMcp:projectName,mcpSpec,agentCoreApplicationfsimport frombin/cdk.tsAPI key credential ARNs not collected during deploy (
e178d79)createApiKeyProviderandupdateApiKeyProvidernow fetch and returncredentialProviderArnvia Get call after create/updateApiKeyProviderSetupResultnow includescredentialProviderArnfielddeployedCredentialsmap collects ARNs from both API Key and OAuth credential providers (previously only OAuth ARNs were collected)CDK template credential passthrough (
ac4a5af)bin/cdk.tsreadsdeployed-state.jsonand extracts credential ARNs per deployment targetcdk-stack.tsacceptscredentialsprop and passes it toAgentCoreMcpconstructTUI deploy flow reorder (
e01a7fc)hasIdentityApiProviders+hasIdentityOAuthProviders) before CDK synth in TUI preflightOAuth credential ARN fetch (
8303abc)createOAuth2ProviderandupdateOAuth2Providernow fetchcredentialProviderArnvia Get call after create/update (same pattern as API Key fix)Gateway output parser (
c54ade7)Mcpprefix in CloudFormation output keys (CDK nests gateway underMcp/Gateway{Name}, producing output keys likeMcpGatewayMyGatewayUrlOutputinstead ofGatewayMyGatewayUrlOutput)CDK version bump (
1d78ead)aws-cdk-libto2.239.0in project template — required forcredentialProviderConfigurationsto be optional (NoAuth support for MCP server targets)Without these fixes, deploying a gateway target with outbound auth fails with
Credential "X" not found in deployed state.Related Issue
Part of the MCP Gateway Phase 1 integration (gateway-integration branch).
Type of Change
Testing
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsEnd-to-end tested: deployed gateway targets with both OAuth and NoAuth, agent successfully invoked tools through the gateway.
Checklist