Skip to content

fix: fix the build command to build a project that has no deployment targets - #2011

Open
notgitika wants to merge 1 commit into
aws:refactorfrom
notgitika:fix/project-build-without-targets
Open

fix: fix the build command to build a project that has no deployment targets#2011
notgitika wants to merge 1 commit into
aws:refactorfrom
notgitika:fix/project-build-without-targets

Conversation

@notgitika

@notgitika notgitika commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Error:

project build failed on every freshly created project:

AgentCore CDK synthesis failed: No deployment targets configured.
Please define targets in agentcore/aws-targets.json

project create scaffolds agentcore/aws-targets.json as an empty list, but the generated CDK app threw on an empty list and synthesized one stack per target — so a new project had nothing to synthesize.

Fix:

Build does not need to know where a project deploys. An empty target list now synthesizes a single environment-agnostic stack, resolving account and region from CloudFormation pseudo-parameters instead of pinning them at synth time.

That stack is named AgentCore-<project> and carries no agentcore:target-name tag, so it is not a deploy candidate. A project that does configure targets is unaffected.

`project create` scaffolds `agentcore/aws-targets.json` as an empty list, but
the generated CDK app threw on an empty list and synthesized one stack per
target, so a freshly created project had nothing to synthesize and
`project build` failed:

    AgentCore CDK synthesis failed: No deployment targets configured.
    Please define targets in agentcore/aws-targets.json

Build does not need to know where a project deploys. An empty target list now
synthesizes a single environment-agnostic stack, which resolves its account and
region from CloudFormation pseudo-parameters instead of pinning them at synth
time. That is enough to compile the app and produce a template, which is what
build is for.

The fallback stack is named `AgentCore-<project>` and carries no
`agentcore:target-name` tag, so it is not a deploy candidate: only a stack
synthesized for a real target is tagged, and selecting on that tag is how a
stack is chosen to ship.

A project that does configure targets is unaffected, still synthesizing one
environment-pinned, target-tagged stack per entry.
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentcore-harness-reviewing AgentCore Harness review in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant