Add bedrock-prompt-management-lambda-sam pattern - #3293
Open
manishh-13 wants to merge 1 commit into
Open
Conversation
Manage and version Amazon Bedrock prompts as CloudFormation resources (AWS::Bedrock::Prompt + AWS::Bedrock::PromptVersion) and invoke them from AWS Lambda through the Converse API, with no prompt text in function code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Submission issue: #3294
Description:
Adds a new pattern: bedrock-prompt-management-lambda-sam.
This pattern defines an Amazon Bedrock managed prompt and a published version as native CloudFormation resources (
AWS::Bedrock::PromptandAWS::Bedrock::PromptVersion), and invokes the prompt from AWS Lambda through the Bedrock Converse API. The prompt text lives in Bedrock, not in the function, so a prompt can be updated or rolled back by publishing a new version and repointing the function, with no function code change.Highlights:
modelIdand suppliespromptVariables; the function holds no prompt text.bedrock:GetPromptandbedrock:RenderPromptscoped to this prompt,bedrock:InvokeModelon the model or inference profile.Language: Python 3.13. Framework: AWS SAM. Level: 200.
Tested end to end: deployed with
sam buildandsam deploy, invoked the function to summarize input text via the managed prompt, then published a new prompt version and repointed the function to confirm the output changes with no code change.By submitting this pull request, I confirm that my contribution is made under the terms of the MIT-0 license.