Repository navigation
New serverless pattern - appconfig-ai-model-lambda-bedrock-typescript-cdk - #3561
Open
NithinChandranR-AWS wants to merge 1 commit into
Conversation
…Amazon Bedrock model settings with AWS AppConfig and AWS Lambda - AWS AppConfig AI model invocation profile (L1, type AWS.AppConfig.AIModelInvocation) with version 1 deployed at stack creation - Linear rollout strategy and an environment monitor on a CloudWatch alarm for the function's errors, for automatic rollback - Monitor role trusts appconfig.amazonaws.com only with aws:SourceAccount set to the stack account - AWS Lambda function (Node.js, arm64) reads the configuration through the AWS AppConfig Agent Lambda extension and maps it onto Bedrock Converse - IAM allows two Amazon Nova models only (geo inference profile plus destination Region model ARNs) - README Testing covers a model switch rollout, schema validation and an alarm-driven rollback
This branch has not been deployed
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.
Description
Roll out Amazon Bedrock model settings with AWS AppConfig and AWS Lambda. The model ID, inference parameters and system prompt live in an AWS AppConfig AI model invocation configuration profile (
AWS.AppConfig.AIModelInvocation); a Lambda function reads them through the AWS AppConfig Agent Lambda extension and maps them onto a Bedrock Converse call, and a CloudWatch alarm on the function's errors makes AWS AppConfig roll a bad model or prompt change back. Claim issue: #3560.Key Innovation
First AWS AppConfig AI model invocation profile pattern in the repo, and the first AppConfig environment monitor with alarm-driven rollback. A model or prompt change becomes a gradual configuration deployment instead of a code deployment.
Architecture
AWS AppConfig (AI model invocation profile, linear strategy, environment monitor) -> AWS Lambda (AWS AppConfig Agent extension) -> Amazon Bedrock Converse; Amazon CloudWatch alarm on Lambda errors -> AWS AppConfig rollback
Deployed and Tested
Stack deploys in us-west-2 (~100 s) and eu-central-1, 14 CloudFormation resources. README Testing run as written in zsh and in bash 3.2 on fresh stacks:
COMPLETEin 9 minutes; the answers show the new model.ROLLED_BACK(ROLLBACK_COMPLETED CLOUDWATCH_ALARM) about 4 minutes after the start; the next call was served by version 2 again.topP2 is rejected at version creation withBadRequestException.Checklist
aws:SourceAccount)validate.jspasses, including the admin IAM checkThe 12-digit numbers in
lib/appconfig-ai-model-lambda-bedrock-stack.tsare the AWS-owned accounts that publish the AWS AppConfig Agent Lambda extension layers, copied from the extension versions page.