Support pre-built container image URI in agentcore deploy (skip CodeBuild)
- Vorherrschende Sprache
- TypeScript
- Sterne
- 283
- Forks
- 95
- Ø Merge
- 1 T. 2 Std.
- Gemergte PRs (30 T.)
- 183
Beschreibung
### Description
Currently, the Container build type always builds images via AWS CodeBuild during agentcore deploy. This doesn't support workflows where users cross-compile for a different architecture, use custom CI/CD pipelines that push images to ECR before deploying, or want to avoid redundant builds when the image already exists in ECR.
Add a `--container-uri ` flag to agentcore deploy that accepts a pre-built ECR image URI and wires it directly to AgentCoreRuntime, bypassing the CodeBuild step entirely.
Example usage:
`agentcore deploy -y --container-uri 123456789012.dkr.ecr.us-west-2.amazonaws.com/myproject/myagent:abc123`
The container URI is passed to the CDK app via an environment variable (AGENTCORE_CONTAINER_URI) so the CDK toolkit wrapper doesn't need modification. When set, the CDK stack creates an AgentCoreRuntime construct directly with the pre-built image instead of going through the AgentCoreApplication (CodeBuild) path.
### Acceptance Criteria
- [ ] `agentcore deploy --container-uri ` deploys using the provided ECR image without triggering a CodeBuild build
- [ ] Invalid ECR URI formats are rejected with a clear error message before deployment starts
- [ ] Dockerfile validation is skipped when `--container-uri` is provided
- [ ] The flag triggers non-interactive (CLI) mode
- [ ] `DeployOptions` and `ValidatedDeployOptions` interfaces include the optional `containerUri` field
- [ ] The CDK stack branches correctly: `containerUri` set → `AgentCoreRuntime` with pre-built image; unset → existing `AgentCoreApplication` (CodeBuild) path
- [ ] `CfnOutput` for `RuntimeId` and `RuntimeArn` is emitted in the pre-built image path
- [ ] Unit tests cover: URI validation (valid/invalid formats), Dockerfile validation skip, env var propagation, CDK stack branching logic
- [ ] Existing Container build type (no `--container-uri`) continues to work unchanged
### Additional Context
This currently assumes a single agent (spec.agents[0]). We likely would want to address multi-agent/multi-URI mappings somehow.
The ECR repo must already exist with the referenced tag.
Beitragsleitfaden
Rechercherichtung
Beginne am agentcore deploy-Einstiegspunkt und verfolge DeployOptions, ValidatedDeployOptions und die Umgebungsvariable AGENTCORE_CONTAINER_URI bis in den CDK-Stack. Überprüfe die Zweige AgentCoreRuntime und AgentCoreApplication und füge anschließend Tests für die URI-Validierung, das Überspringen des Dockerfile, die Weitergabe, die Ausgaben und das unveränderte Standardverhalten hinzu. Als abgeschlossen gilt die Aufgabe, wenn alle Akzeptanzkriterien erfüllt sind, ohne CodeBuild für eine gültige vorgefertigte ECR-URI auszulösen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- aws, docker, typescript
- Bereich
- cli, cloud, devops, infrastructure
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100