Skip to content

Conversation

@kimsbrian
Copy link
Contributor

Issue # (if applicable)

N/A

Reason for this change

Users currently need ECR repository constructs (fromEcrRepository) or local Docker assets (fromAsset) to reference container images in AgentCore runtimes. This creates friction when:

  • Container URIs come from CloudFormation parameters or stack outputs
  • Referencing images in external registries (Docker Hub, private registries)
  • Working with cross-stack or cross-account image references

Description of changes

Added fromImageUri() static method to AgentRuntimeArtifact class:

  • Created ImageUriArtifact class extending AgentRuntimeArtifact
  • Accepts container URI as a string (supports CloudFormation tokens/expressions)
  • No automatic IAM permissions granted (user manages permissions separately)
  • Follows existing patterns from EcrImage and AssetImage classes

This provides a fourth deployment option alongside fromEcrRepository(), fromAsset(), and fromS3().

Description of how you validated changes

Unit tests added:

  • Basic URI reference test
  • CloudFormation token support test
  • Verification that no permissions are required

Manual testing:
bash
cd packages/@aws-cdk/aws-bedrock-agentcore-alpha
yarn build
yarn test

All tests pass.

Production usage:
This change has been built locally and used successfully in my application to reference container images via CloudFormation parameters.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team December 1, 2025 18:23
@github-actions github-actions bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Dec 1, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@kimsbrian
Copy link
Contributor Author

Exemption Request

This doesn't need an integration test. It's adding another way to pass a container URI to the same CloudFormation property that fromEcrRepository() and fromAsset() already use.

The method is a simple pass-through. It takes a string and sets containerUri. No new CloudFormation resources, no cross-service configuration, just an alternative to the existing methods.

Unit tests cover the behavior (URI reference, CloudFormation tokens, no auto-permissions).

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Dec 1, 2025
@alvazjor alvazjor self-assigned this Dec 2, 2025
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 2, 2025
@kimsbrian
Copy link
Contributor Author

@alvazjor Thanks for the feedback. Reading the container uri pattern requirement shows it only accepts ECR which means that external repos unfortunately can't be used. Maybe it's worthwhile to eventually enable this from the Bedrock agentcore side. At least for my use case, I'm still happy to have this change in. Updated the documentation and comments to reflect ECR only containers are supported.

@alvazjor alvazjor added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Dec 3, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review December 3, 2025 17:10

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@alvazjor
Copy link
Contributor

alvazjor commented Dec 3, 2025

@kimsbrian there is a linting issue in the PR, that is why the build keeps failing
https://github.com/aws/aws-cdk/actions/runs/19901668989/job/57048002305?pr=36263#step:9:3580

@mergify mergify bot dismissed alvazjor’s stale review December 3, 2025 17:34

Pull request has been modified.

@mergify
Copy link
Contributor

mergify bot commented Dec 3, 2025

Merge Queue Status Beta

✅ The pull request has been merged

This pull request spent 6 seconds in the queue, with no time running CI.
The checks were run in-place.

Required conditions to merge

@mergify
Copy link
Contributor

mergify bot commented Dec 3, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit ad25aba into aws:main Dec 3, 2025
21 of 22 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 3, 2025
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants