This repository contains sample applications demonstrating LocalStack Pro features for AWS service emulation. Each sample showcases real-world AWS patterns that can be developed and tested locally using LocalStack.
- Docker - Container runtime for LocalStack
- AWS CLI - AWS command line interface
- awslocal - LocalStack wrapper for AWS CLI
- jq - JSON processor for parsing outputs
- Terraform - Multi-cloud infrastructure provisioning
- AWS SAM CLI - Serverless Application Model
- AWS CDK - Cloud Development Kit
- Python 3.10+ - Required for Python samples
- Node.js 18+ - Required for JavaScript/TypeScript samples
| Sample | Language | IaC Methods | Tests | Notes |
|---|---|---|---|---|
| lambda-function-urls | python | scripts, terraform, cloudformation, cdk | ||
| lambda-function-urls | javascript | scripts, terraform, cloudformation, cdk | ||
| stepfunctions-lambda | python | scripts, terraform, cloudformation, cdk | ||
| web-app-dynamodb | python | scripts, terraform, cloudformation, cdk | ||
| lambda-s3-http | python | scripts, terraform, cloudformation, cdk | ||
| lambda-cloudfront | python | scripts, terraform, cloudformation, cdk | ||
| web-app-rds | python | scripts, terraform, cloudformation, cdk | ||
| apigw-custom-domain | python | scripts, terraform, cloudformation, cdk | ||
| ecs-ecr-app | python | scripts, terraform, cloudformation, cdk | ||
| lambda-container-image | python | scripts, terraform, cloudformation, cdk | ||
| apigw-websockets | javascript | scripts, terraform, cloudformation, cdk | ||
| lambda-layers | javascript | scripts, terraform, cloudformation, cdk | ||
| lambda-event-filtering | javascript | scripts, terraform, cloudformation, cdk | ||
| lambda-xray | python | scripts, terraform, cloudformation, cdk | ||
| codecommit-git-repo | python | scripts, terraform | CloudFormation/CDK unsupported | |
| iot-basics | python | scripts, terraform, cloudformation, cdk | 1 test skipped (MQTT endpoint) | |
| athena-s3-queries | python | scripts, terraform, cloudformation, cdk | Requires Hadoop download | |
| mq-broker | python | scripts, terraform, cloudformation, cdk | Requires JDK/ActiveMQ download | |
| transfer-ftp-s3 | python | scripts | Terraform/CloudFormation/CDK unsupported | |
| glacier-s3-select | python | scripts | Terraform/CloudFormation/CDK unsupported | |
| rds-db-queries | python | scripts | Requires PostgreSQL download | |
| rds-failover-test | python | scripts | Terraform/CloudFormation/CDK unsupported | |
| neptune-graph-db | python | scripts | Requires Java/TinkerGraph download | |
| iam-policy-enforcement | python | scripts | Requires ENFORCE_IAM=1 | |
| ec2-docker-instances | python | scripts | Requires EC2_VM_MANAGER=docker | |
| cloudwatch-metrics-aws | python | scripts | Email requires SMTP | |
| cognito-jwt | python | scripts | Email verification requires SMTP | |
| chalice-rest-api | python | scripts | Requires chalice-local | |
| elb-load-balancing | javascript | scripts | ALB with Lambda targets |
Each sample follows a consistent organization:
samples/{sample-name}/
├── {language}/ # python, javascript, etc.
│ ├── README.md # Sample documentation
│ ├── scripts/ # Deployment and test scripts
│ │ ├── deploy.sh # Primary deployment script
│ │ ├── validate.sh # Resource validation
│ │ └── test.sh # Functional tests
│ ├── terraform/ # Terraform configuration (optional)
│ │ ├── main.tf
│ │ ├── providers.tf
│ │ ├── variables.tf
│ │ └── outputs.tf
│ ├── sam/ # SAM template (optional)
│ │ └── template.yaml
│ └── src/ # Application source code
- Start LocalStack Pro:
export LOCALSTACK_AUTH_TOKEN=your-auth-token
docker run -d --name localstack \
-p 4566:4566 \
-e LOCALSTACK_AUTH_TOKEN \
-v /var/run/docker.sock:/var/run/docker.sock \
localstack/localstack-pro- Run all tests:
./run-samples.sh- Run a specific sample:
./run-samples.sh SHARD=1 SPLITS=5make install # Install dependencies
make test # Run all tests
make logs # Show LocalStack logsIf scripts fail with \r errors on Windows/WSL:
git config core.autocrlf false
git checkout -- .Verify LocalStack is running:
curl http://localhost:4566/_localstack/healthSee docs/LOCALSTACK.md for detailed LocalStack configuration options.
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-sample - Make your changes following the sample structure conventions
- Test locally with LocalStack
- Submit a pull request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- GitHub Issues - Bug reports and feature requests
- LocalStack Slack - Community support
- LocalStack Pro Support - Enterprise support