Github repo: https://github.com/localstack/shipment-list-demo
You run your Spring Boot application on AWS for production. But where do you test it? Probably on AWS as well; however, there are good reasons for reconsidering: development speed and cost. Let’s see how you can do that with the help of LocalStack.
Let’s say you run your Spring Boot application on AWS and provision the infrastructure with Terraform, which is almost the default by now. You can switch it to run for development and testing to a local installation in three easy steps:
-configure your dev environment variables
-start LocalStack on Docker
-run your IaC (infrastructure as code) configuration files
Allow me to elaborate: in this presentation, we leverage one of the core features of the Spring framework that allows us to bind our beans to different profiles and configure our environments. This also gives you the opportunity to test your IaC and make sure it’s consistent across all environments. While production will continue to run on AWS resources, dev will use high-fidelity emulations that run directly on your machine. Our application preserves the behavior we see on AWS. That means faster and cheaper dependencies.