Welcome to CD CI AWS ECS Demo, Simple Rest API built with Spring Boot which then gets deployed to AWS ECS
- Authentication with JWT
- Unit & Integration Tests
- Deploying Spring Boot App to AWS ECS
- Go to
application.properties
file in spring boot app and fill it with your credentials.
- Navigate into root folder and then, find create .env file.
- Fill your secrets, have a look at
application.properties
it'll give you info about how to reference the secrets. - Run
export $(cat .env | xargs)
and then, runmvn spring-boot:run
. - Optionally, you can run
DATABASE_URL=url other-secrets mvn spring:boot run
. - If you fill the credentials which work, your app should start successfully.
- The connection is tested with AWS RDS so, you can use it confidently.
- mvn test
docker build -t e2eecsdemo .
docker run -p 8080:8080 -e SPRING_DATASOURCE_URL=jdbc:postgresql://AWS-RDS-URL:5432/postgres -e SPRING_DATASOURCE_USERNAME=postgres -e SPRING_DATASOURCE_PASSWORD=password e2eecsdemo
- /health - Health Check API for AWS ALB see CDK Stack for detailed info.
- /auth/signup - POST - Sign Up
- /auth/login - POST - Sign In / Login
- Requests below require Authorization Header: Bearer JWT
- /categories - GET - Lists categories
- /categories - POST - Add new category with given name
- /categories/id - GET - Finds category for given id.
- /categories/id - PUT - Updates category for given id.
- /categories/id - DELETE - Deletes category for given id.
- /categories/id/products - Lists products for given category id.
- Requests below require Authorization Header: Bearer JWT
- /products - POST - Add new product with given name, price, category_id
- /products/id - GET - Finds product for given id.
- /products/id - PUT - Updates product for given id.
- /products/id - DELETE - Deletes product for given id.
- /ecs/demo - Returns with the current timestamp.