A sample product API built with API Gateway, Lambda (Java), and DynamoDB, designed for collaborative debugging workflows using LocalStack Cloud Pods. Follow the end-to-end walkthrough for this project: https://docs.localstack.cloud/aws/tutorials/cloud-pods-collaborative-debugging/
- A valid LocalStack for AWS license, which provides a
LOCALSTACK_AUTH_TOKENrequired to run this sample. - Docker for running LocalStack.
- Maven and Java 21 for building the Lambda functions.
- Terraform or OpenTofu with
lstk, installed vianpm install -g @localstack/lstkorbrew install localstack/tap/lstk.
export LOCALSTACK_AUTH_TOKEN=<your-auth-token>- Start LocalStack:
docker compose up -d- Build Lambda artifacts:
cd lambda-functions
mvn clean package- Deploy infrastructure:
cd terraform
./run-tflocal.sh- Invoke the API:
./invoke.shFor OpenTofu, set LSTK_TF_CMD=tofu and run lstk tf in opentofu/ (see opentofu/instructions.md).
- Test the scenario from the tutorial:
./test.shThe test needs LocalStack to enforce IAM, as docker-compose.yml does with ENFORCE_IAM=1. With lstk, start it with LOCALSTACK_ENFORCE_IAM=1 lstk start. It adds two products, checks that reading one fails because the policy is missing dynamodb:GetItem, then adds the permission and checks the read works. It restores the original policy version when it exits. Set TF_DIR=opentofu to test the OpenTofu deployment.
Licensed under Apache License 2.0. See LICENSE.
