Skip to content

feat(typescript): add 3 Bedrock CDK examples (durable, streaming, S3 Vectors)#1266

Open
NithinChandranR-AWS wants to merge 1 commit intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-bedrock-cdk-examples
Open

feat(typescript): add 3 Bedrock CDK examples (durable, streaming, S3 Vectors)#1266
NithinChandranR-AWS wants to merge 1 commit intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-bedrock-cdk-examples

Conversation

@NithinChandranR-AWS
Copy link
Copy Markdown

Description

Adds three new TypeScript CDK examples demonstrating re:Invent 2025 serverless launches integrated with Amazon Bedrock. These are cross-posted from aws-samples/serverless-patterns (PRs #3053, #3054, #3055) and adapted to the aws-cdk-examples standalone format.

1. typescript/lambda-durable-bedrock — Durable Functions + Bedrock

Multi-step AI content generation with automatic checkpointing. If step 3 fails, execution resumes from step 3 — not step 1. No duplicate Bedrock charges.

  • Uses @aws/durable-execution-sdk-js + DurableConfig escape hatch
  • Requires nodejs24.x runtime
  • Original PR: serverless-patterns#3053

2. typescript/apigw-streaming-lambda-bedrock — REST API Streaming + Bedrock

Streams Bedrock tokens via Server-Sent Events through standard REST API Gateway. First token arrives in <500ms vs 5-15s buffered wait.

  • Uses ResponseTransferMode: STREAM in CfnIntegration + streamifyResponse() wrapper
  • Original PR: serverless-patterns#3054

3. typescript/s3-vectors-lambda-bedrock — S3 Vectors RAG Pipeline

RAG pipeline using S3 Vectors for vector storage at S3 pricing. No OpenSearch/Pinecone/pgvector needed.

  • Uses Titan Embeddings v2 (1024-dim) + cosine similarity search
  • Custom Lambda with bundled @aws-sdk/client-s3vectors (not in Lambda runtime)
  • Original PR: serverless-patterns#3055

All examples include:

  • Least-privilege IAM with scoped Bedrock permissions
  • Full README with architecture, build, deploy, and test instructions
  • Stability banner (Experimental)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Add three new TypeScript CDK examples demonstrating re:Invent 2025
serverless launches integrated with Amazon Bedrock:

- lambda-durable-bedrock: Multi-step AI workflow with durable functions
- apigw-streaming-lambda-bedrock: REST API response streaming
- s3-vectors-lambda-bedrock: RAG pipeline with S3 Vectors

All examples use least-privilege IAM with scoped Bedrock permissions.
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.

1 participant