You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description (mid-length e.g. "Create a Lambda function that sends events to EventBridge.")
This pattern demonstrates how to implement long-running invocations with Amazon Bedrock using AWS AppSync subscriptions and AWS Lambda in Event Mode, following the official AWS AppSync documentation pattern.
Language: (optional e.g. "Python", if you have a Lambda function in your example)
Typescript
YouTube videoId (optional e.g. "VI79XQW4dIM")
Framework (currently we support SAM or CDK)
CDK
Services from/to (e.g. "Lambda to EventBridge)
AppSync to Lambda to Bedrock Streaming
Description (this must include a throughout explanation of the pattern together with details of IAM permissioning)
Client initiates a WebSocket subscription and makes a request to AppSync
AppSync invokes Lambda function in Event mode, enabling asynchronous processing
Lambda function streams responses from Bedrock using ConverseStream
Lambda sends updates via mutations to AppSync
Updates are delivered to client through WebSocket subscription
Key Benefits
Asynchronous Processing: AppSync immediately returns a response while Lambda processes the request asynchronously, preventing timeouts for long-running operations
Real-time Updates: Clients receive progressive updates through WebSocket subscriptions as the model generates responses
Use the model template located at https://github.com/aws-samples/serverless-patterns/tree/main/_pattern-model to set up a README, template and any associated code.
Description (mid-length e.g. "Create a Lambda function that sends events to EventBridge.")
This pattern demonstrates how to implement long-running invocations with Amazon Bedrock using AWS AppSync subscriptions and AWS Lambda in Event Mode, following the official AWS AppSync documentation pattern.
Language: (optional e.g. "Python", if you have a Lambda function in your example)
Typescript
YouTube videoId (optional e.g. "VI79XQW4dIM")
Framework (currently we support SAM or CDK)
CDK
Services from/to (e.g. "Lambda to EventBridge)
AppSync to Lambda to Bedrock Streaming
Description (this must include a throughout explanation of the pattern together with details of IAM permissioning)
The pattern implements an asynchronous streaming architecture where:
Key Benefits
Deployment commands
cd appsync-lambda-bedrock-async-stream-subscription-cdk
Testing
After deployment, you can test the Bedrock streaming integration using the provided test script. The script demonstrates:
Run the test script using:
GitHub PR for template:
#2553
Payload example (e.g. Lambda event payload from source service).
N/A
Additional resources (optional: link and anchor text, up to 5 resources)
https://docs.aws.amazon.com/appsync/latest/devguide/resolver-reference-bedrock-js.html#long-running-invocations
Author bio
Name: Kaustav Dey
Photo URL: https://github.com/kaustavbecs.png
Twitter handle: n/a
LinkedIn: https://www.linkedin.com/in/kaustavbecs/
Description (up to 255 chars): I am a Solutions Architect working for AWS.
GitHub PR for template:
#2553
The text was updated successfully, but these errors were encountered: