aws / aws/agentcore-cli

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

Offen
#2,104 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
290
Forks
96
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
183

Beschreibung

## 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit src/assets/cdk/bin/cdk.ts und der dortigen toStackName-Logik und untersuche anschließend src/core/project/backends/cdk.ts auf die bestehende Kontoprüfung. Verfolge die Projektinitialisierung und die agentcore.json-Projektspezifikation, um zu bestimmen, wo eine festgeschriebene stabile ID hingehört. Als erledigt gilt die Aufgabe, wenn Projekte mit demselben Namen nicht mehr kollidieren und die Bereitstellung einen Stack mit einer anderen Projekt-ID ablehnt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, typescript
Bereich
cloud, infrastructure
Issue-Typ
Bug
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
39/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.