This repository contains sample projects that can be deployed on your local machine using LocalStack.
Each example in the repository is self-contained and can be deployed individually using Pulumi and LocalStack. The directory names are self-explanatory and each directory contains a README.md with sample-specific instructions.
- A valid LocalStack for AWS license. Your license provides a
LOCALSTACK_AUTH_TOKEN. - Docker
lstkor thelocalstackCLIawslocalCLI, orlstk aws- Pulumi
pulumilocalCLImakeandjq
Set your auth token before running any sample:
export LOCALSTACK_AUTH_TOKEN=<your-auth-token>Alternatively, use the LocalStack CLI:
localstack auth set-token <your-auth-token>You can find your auth token in the LocalStack Web Application.
The Makefile deploys one example to LocalStack with a local Pulumi backend and runs its test.sh:
lstk start
make install deploy test EXAMPLE=s3-static-website
make destroy EXAMPLE=s3-static-websitemake deploy uses the stack localstack and stores Pulumi state in .pulumi-state/. Each test.sh checks the example works the way its README describes, for example that the API counts requests or that a published message reaches the result queue. CI runs every example this way on each pull request.
The test scripts need lstk, jq and curl. The EKS test also needs kubectl and the AWS CLI.
| Sample Name | Description |
|---|---|
| AppSync DynamoDB Endpoint | GraphQL endpoint in AppSync with DynamoDB integration |
| AWS API Gateway Auth0 | API Gateway integration with Auth0 for authentication and authorization |
| AWS Lambda StepFunctions | Step Functions orchestration with Lambda functions |
| Elastic Kubernetes Service | Provisioning and configuring an EKS cluster |
| Lambda Kinesis Firehose ES | Lambda, Kinesis, Firehose, and Elasticsearch integration |
| Lambda Layers | Lambda Layers for shared code and dependencies |
| S3 SQS Queues | Store SQS message data in S3 |
| S3 Static Website | Static website hosting on S3 using Pulumi |
| Serverless REST API | Serverless REST API using AWS managed services |
| SNS, SQS, and Lambda integration | SNS topic + SQS queue + Lambda event flow |
To check out only one sample directory:
mkdir localstack-pulumi-samples && cd localstack-pulumi-samples
git init
git remote add origin -f git@github.com:localstack-samples/localstack-pulumi-samples.git
git config core.sparseCheckout true
echo <LOCALSTACK_SAMPLE_DIRECTORY_NAME> >> .git/info/sparse-checkout
git pull origin masterThe commands above use sparse checkout to pull only the sample you need.
This code is available under Apache License 2.0.