Project deploy: same project name + target collides on one CloudFormation stack
- Lingua principale
- TypeScript
- Stelle
- 283
- Fork
- 95
- Merge medio
- 1g 2h
- PR unite (30g)
- 183
Descrizione
## 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--` (`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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia da src/assets/cdk/bin/cdk.ts e dalla relativa logica toStackName, quindi esamina src/core/project/backends/cdk.ts per trovare il controllo dell'account esistente. Segui l'inizializzazione del progetto e la specifica del progetto agentcore.json per determinare dove deve essere inserito un id stabile sottoposto a commit. Il lavoro è completato quando i progetti con lo stesso nome non entrano più in conflitto e il deployment rifiuta uno stack che contiene un id di progetto diverso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- aws, typescript
- Ambito
- cloud, infrastructure
- Tipo di issue
- Bug
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Attiva
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 39/100