Skip to content

New serverless pattern - lambda-microvms-multi-tenant-ai-agents#3215

Open
hustshawn wants to merge 4 commits into
aws-samples:mainfrom
hustshawn:hustshawn-feature-lambda-microvms-multi-tenant-ai-agents
Open

New serverless pattern - lambda-microvms-multi-tenant-ai-agents#3215
hustshawn wants to merge 4 commits into
aws-samples:mainfrom
hustshawn:hustshawn-feature-lambda-microvms-multi-tenant-ai-agents

Conversation

@hustshawn

Copy link
Copy Markdown

Issue #, if available:

Description of changes:

This pattern runs a self-hosted AI agent one isolated Lambda MicroVM per tenant: per-tenant state persisted on Amazon EFS, Amazon Bedrock via a VPC endpoint, and an orchestrator Lambda (API Gateway + DynamoDB registry + EventBridge sweeper) that cold-starts, resumes, and reaps tenant VMs on demand. The MicroVM image and VPC egress connector are declared natively in CloudFormation (AWS::Lambda::MicrovmImage / AWS::Lambda::NetworkConnector); deploy is a single script. Includes an optional Telegram push front-end per tenant.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@hustshawn
hustshawn force-pushed the hustshawn-feature-lambda-microvms-multi-tenant-ai-agents branch from 7c30c9b to 68404c3 Compare July 7, 2026 03:44
@hustshawn
hustshawn force-pushed the hustshawn-feature-lambda-microvms-multi-tenant-ai-agents branch from 68404c3 to 2cad966 Compare July 11, 2026 02:53
@hustshawn

Copy link
Copy Markdown
Author

Hello team, could you please help review and merge? This has been asked from the internal channels.

@marcojahn marcojahn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shared findings and recommendations with the @hustshawn directly.

… multi-region + Scan pagination fixes

Reviewer feedback (Marco Jahn) on the lambda-microvms-multi-tenant-ai-agents pattern:

CLI ergonomics:
- Reorder all four scripts to region-first with sensible defaults
  (deploy.sh/teardown.sh default to us-east-1/openclaw-mt).

Security (sensible defaults applied; demo-burdensome items documented instead):
- add-tenant.sh + router now fail closed on Telegram webhook secret.
- DynamoDB tenants table: explicit KMS SSE.
- iam:PassRole gains an iam:PassedToService condition.
- Document the unauthenticated /chat test route and the demo gateway-token
  fallback in code + a new README Security considerations section.

Correctness / functionality:
- materialize-models.mjs derives Bedrock baseUrl + discovery region from
  AWS_REGION so non-us-east-1 deploys use the in-region endpoint.
- Sweeper paginates the DynamoDB Scan and logs failed terminates.

Docs/metadata: Amazon-prefix service names on first reference; update all
command examples to the new argument order.

Add .gitignore for __pycache__/ and *.pyc.
@hustshawn

Copy link
Copy Markdown
Author

Thank you @marcojahn , addressed the issues with the new commit.

@marcojahn marcojahn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @hustshawn, thans for the bunch of updates. One small request for change. Then all good and ready to go.

Comment thread lambda-microvms-multi-tenant-ai-agents/README.md Outdated
hustshawn and others added 2 commits July 21, 2026 22:57
Co-authored-by: Marco <marco.jahn@gmail.com>
added lambda-microvms-multi-tenant-ai-agents.json

@marcojahn marcojahn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @hustshawn, thank you for your contribution. Your PR will be merged soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants