Skip to content

Add bedrock-prompt-management-lambda-sam pattern - #3293

Open
manishh-13 wants to merge 1 commit into
aws-samples:mainfrom
manishh-13:manishh-13-feature-bedrock-prompt-management
Open

Add bedrock-prompt-management-lambda-sam pattern#3293
manishh-13 wants to merge 1 commit into
aws-samples:mainfrom
manishh-13:manishh-13-feature-bedrock-prompt-management

Conversation

@manishh-13

@manishh-13 manishh-13 commented Aug 29, 2026

Copy link
Copy Markdown

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::Prompt and AWS::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:

  • Prompt template, input variables, target model, and inference settings are all infrastructure as code.
  • Lambda passes the prompt version ARN as the Converse modelId and supplies promptVariables; the function holds no prompt text.
  • The target model is a template parameter, so it works with any Converse-compatible Bedrock model or cross-region inference profile.
  • Least-privilege IAM: bedrock:GetPrompt and bedrock:RenderPrompt scoped to this prompt, bedrock:InvokeModel on the model or inference profile.

Language: Python 3.13. Framework: AWS SAM. Level: 200.

Tested end to end: deployed with sam build and sam 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants