Hello World on AWS Lambda Managed Instances (Terraform)

Lambda Managed Instances

Deploy a simple Hello World AWS Lambda function on Lambda Managed Instances using Terraform

This pattern demonstrates how to deploy a simple Hello World AWS Lambda function running on AWS Lambda Managed Instances using Terraform.
AWS Lambda Managed Instances enables you to run Lambda functions on EC2 instances while maintaining Lambda's operational simplicity. It fully manages infrastructure tasks including instance lifecycle, OS and runtime patching, routing, load balancing, and auto scaling.
The Hello World function uses ES modules (ESM) and accepts an event with a name parameter and returns a simple JSON response with a greeting message.
The Terraform configuration creates a complete VPC infrastructure with public and private subnets, NAT gateways, and automatically associates the Lambda function with a capacity provider for managed instances.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-managed-instances-tf

Deploy

cd lambda && npm install && cd ..terraform initterraform applySee the Readme file for detailed deployment instructions.


Testing

See the Readme file for detailed testing instructions.

Cleanup

Delete the infrastructure: terraform destroy.
See the Readme file for detailed cleanup instructions.

Created by:

Dmitry Gulin

Dmitry Gulin

Modernization Architect, AWS

Follow on LinkedIn