Project deploy: same project name + target collides on one CloudFormation stack

Open
#2,104 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
39/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
aws, typescript

Research direction

Start with src/assets/cdk/bin/cdk.ts and its toStackName logic, then inspect src/core/project/backends/cdk.ts for the existing account check. Trace project init and the agentcore.json project spec to determine where a committed stable id belongs. Done means same-named projects no longer collide and deployment refuses a stack carrying a different project id.

Written by the indexing model from the issue text.

Description

Summary

Two separate projects that share the same name (in agentcore.json) and target, deployed to the same account+region, resolve to the same CloudFormation stack. The second deploy updates/overwrites the first project's stack instead of creating its own.

Repro

  1. Create two projects in different directories, both name: "demo".
  2. agentcore deploy --target default from each, same account+region.
  3. Both map to stack AgentCore-demo-default; the second deploy overwrites the first's stack.

Root cause

Stack identity is derived solely from (project name, target name) — AgentCore-<name>-<target> (src/assets/cdk/bin/cdk.ts toStackName). The project spec has no stable unique id distinct from the human-chosen name, and the agentcore:project-name tag is just the name, so nothing disambiguates two same-named projects. The deploy path only verifies the account matches the target (src/core/project/backends/cdk.ts), not project identity.

Impact

Silent overwrite of another project's deployed resources when names collide in a shared account+region.

Suggested fix

Generate a stable project id at project init, store it committed in agentcore.json, stamp it as a stack tag (e.g. agentcore:project-id), and refuse to deploy when an existing stack of that name carries a different id.

Dominant language
TypeScript
Stars
339
Forks
129
Avg merge
19h 21m
Merged PRs (30d)
125

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/agentcore-cli

All issues in aws/agentcore-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.