fix: fix the build command to build a project that has no deployment targets - #2011
Open
notgitika wants to merge 1 commit into
Open
fix: fix the build command to build a project that has no deployment targets#2011notgitika wants to merge 1 commit into
notgitika wants to merge 1 commit into
Conversation
`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.
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.
Error:
project buildfailed on every freshly created project:project createscaffoldsagentcore/aws-targets.jsonas 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 noagentcore:target-nametag, so it is not a deploy candidate. A project that does configure targets is unaffected.