isadoramsouza / spring-cloud-localstack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Cloud AWS Project with LocalStack

With LocalStack it's possible to run AWS applications or Lambdas entirely on local machine without connecting to a remote cloud provider.

Installing LocalStack: https://github.com/localstack/localstack

Initializing LocalStack in project with parameters, secrets, buckets, queues and topics already created:

cd ./localstack
docker-compose up
bash localstack.sh

AWS Services:

  • Parameter Store
  • Secrets Manager
  • S3
  • SQS
  • SNS

Running Spring Boot Application with localstack profile

./mvnw spring-boot:run -Dspring-boot.run.profiles=localstack

Testing Application

  • Parameter Store:
  curl --location --request GET 'http://localhost:8080/parameterstore/name'

  curl --location --request GET 'http://localhost:8080/parameterstore/days'
  • Secrets Manageer:
curl --location --request GET 'http://localhost:8080/secretsmanager/configuration'
  • S3:
curl --location --request POST 'http://localhost:8080/file'

curl --location --request GET 'http://localhost:8080/file?fileName={{fileName}}'

curl --location --request GET 'http://localhost:8080/file/{{fileName}}'
  • SQS:
curl --location --request POST 'http://localhost:8080/sqs/send?message={{message}}'
  • SNS:
curl --location --request POST 'http://localhost:8080/sns/send?message={{message}}'

Reference

https://thomasdacosta.com.br/

About


Languages

Language:Java 88.7%Language:Shell 11.3%