-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(bedrock-agentcore): add fromImageUri method to AgentRuntimeArtifact #36263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter fails with the following errors:
❌ Features must contain a change to an integration test file and the resulting snapshot.
If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.
✅ A exemption request has been requested. Please wait for a maintainer's review.
|
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 The method is a simple pass-through. It takes a string and sets Unit tests cover the behavior (URI reference, CloudFormation tokens, no auto-permissions). |
| } | ||
|
|
||
| /** | ||
| * Reference an image using a container URI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add here documentation for the permissions limitation. Something like:
Use this method when you have a pre-existing image URI from CloudFormation parameters, cross-stack references, or external registries.
Note: No IAM permissions are automatically granted. You must ensure the runtime has appropriate permissions to pull from the registry.
| super(); | ||
| } | ||
|
|
||
| public bind(_scope: Construct, _runtime: Runtime): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a small coment here stating why this will be empty
|
|
||
| class ImageUriArtifact extends AgentRuntimeArtifact { | ||
| constructor(private readonly containerUri: string) { | ||
| super(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A validation here for the containerUri is needed. CFN requires a string format, feel free to reuse it: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-properties-bedrockagentcore-runtime-containerconfiguration.html
|
@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. |
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:Description of changes
Added
fromImageUri()static method toAgentRuntimeArtifactclass:ImageUriArtifactclass extendingAgentRuntimeArtifactEcrImageandAssetImageclassesThis provides a fourth deployment option alongside
fromEcrRepository(),fromAsset(), andfromS3().Description of how you validated changes
Unit tests added:
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