An open API service indexing awesome lists of open source software.

https://github.com/localstack-samples/localstack-cloud-pods-blogpost-demo

Demo repository meant to highlight the Cloud Pod functionality of LocalStack
https://github.com/localstack-samples/localstack-cloud-pods-blogpost-demo

Last synced: about 1 year ago
JSON representation

Demo repository meant to highlight the Cloud Pod functionality of LocalStack

Awesome Lists containing this project

README

          

# Cloud Pods Demos

| 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 |

## Purpose

This repository is meant to support the Cloud Pods blog post.

## Architecture Overview

![Diagram](app_diagram.png)

## Prerequisites

To run this sample you will need:

- [Maven 3.8.5](https://maven.apache.org/install.html) & [Java 17](https://www.java.com/en/download/help/download_options.html)
- [Docker](https://docs.docker.com/get-docker/) - for running LocalStack

## Cloud Pods

To better understand everything about state management in LocalStack please refer to the dedicated documentation section: https://docs.localstack.cloud/user-guide/state-management/.

### Quick Setup

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 install `tflocal`: `pip install terraform-local`)
- `tflocal init`
- `flocal plan`
- `flocal apply --auto-approve`

Now you should have all your resources created in your LocalStack instance.

### Saving the snapshot

You'll need your Auth Token:

```
export LOCALSTACK_AUTH_TOKEN="YOUR_AUTH_TOKEN"
```

To save your remote cloud pod:

```
localstack pod save
```

To save your instance’s state locally:

```
localstack state export
```

## Further reading

- 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