Environment | |
---|---|
Services | Amazon S3, Lambda, DynamoDB, SNS, SQS |
Integrations | AWS SDK, Terraform, AWS CLI, Cloud Pods |
Categories | Spring Boot, Testcontainers |
Level | Intermediate |
Works on | LocalStack v3 |
This repository is meant to support the Cloud Pods blog post.
To run this sample you will need:
- Maven 3.8.5 & Java 17
- Docker - for running LocalStack
To better understand everything about state management in LocalStack please refer to the dedicated documentation section: https://docs.localstack.cloud/user-guide/state-management/.
You can refer to the original repository for more information on how to run the full sample: https://github.com/localstack-samples/sample-shipment-list-demo-lambda-dynamodb-s3.
For the quick version, follow these steps:
cd shipment-picture-lambda-validator
mvn clean package shade:shade
- in the root folder
docker compose up
cd terraform
(don't forget to installtflocal
:pip install terraform-local
)tflocal init
flocal plan
flocal apply --auto-approve
Now you should have all your resources created in your LocalStack instance.
You'll need your Auth Token:
export LOCALSTACK_AUTH_TOKEN="YOUR_AUTH_TOKEN"
To save your remote cloud pod:
localstack pod save <pod_name>
To save your instance’s state locally:
localstack state export <my-state>
- Testcontainers LocalStack module - https://java.testcontainers.org/modules/localstack/
- LocalStack user guides - https://docs.localstack.cloud/user-guide/
- Testcontainers workshop - https://github.com/testcontainers/workshop