Skip to content

fix(deploy): synthesize only selected deployment targets - #2590

Open
proton0210 wants to merge 1 commit into
aws:mainfrom
proton0210:fix/deploy-selected-target
Open

proton0210 wants to merge 1 commit into
aws:mainfrom
proton0210:fix/deploy-selected-target

Conversation

@proton0210

Copy link
Copy Markdown

Description

agentcore deploy --target dev can fail with Credential "api-key" not found in deployed state because the generated CDK app constructs every configured target, including targets whose credentials have not been provisioned.

Pass the selected target names to the CDK child process and filter before stack construction. CLI deployment scopes synthesis to its target; interactive deployment preserves the full multi-selection. Standalone CDK synthesis still includes every target. Invalid selections fail before any stack is constructed, and missing credentials on a selected target still fail normally.

Existing generated projects retain their CDK source on upgrade; the configuration guide includes the precise update for their entry point. No construct-package update is required.

Related Issue

Closes #2569.

Documentation PR

Included in docs/configuration.md.

Type of Change

  • Bug fix
  • Documentation update

Testing

  • 61 focused tests pass, including generated-entry-point execution, child environment isolation, shared synthesis forwarding, and interactive target selection. The core regression fails against the original entry point.
  • Six local synthesis checks using the real published @aws/agentcore-cdk@0.1.0-alpha.54 pass, covering the original failure, API-key/OAuth credentials, multiple selected targets, missing selected credentials, and standalone all-target synthesis. Each generated template contains only its own target's credential ARN.
  • Built unit run: 6,358 passed. Python scaffolding failures from a missing uv prerequisite were resolved by a passing 36-test rerun. Two unrelated tests still fail because their shell commands do not quote checkout paths containing spaces; reproduced on pristine upstream code.
  • Local integration run: 353 passed, 3 skipped. The separate dev-server suite's setup hook timed out while creating/installing its project (120 seconds); no deployment or synthesis regression was reported.
  • CLI and vended-CDK typechecks, build, formatting, whitespace, and secrets checks pass. Lint passes with existing repository warnings; changed CLI files are clean.
  • Intentional asset snapshot updated; all 139 asset snapshot tests pass.

No live AWS deployment was performed.

Checklist

  • I have read the CONTRIBUTING document
  • I have added regression tests
  • I have updated the documentation, including existing-project migration steps
  • My changes generate no new warnings
  • No dependent package changes are required

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@proton0210
proton0210 requested a review from a team October 13, 2026 21:17
@github-actions github-actions Bot added the size/m PR size: M label Oct 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deploy --target fails in multi-target projects: synth builds every target but credentials are only provisioned for the selected one

1 participant