Set up your own credentials to be able to connect to dependent AWS services:
export AWS_ACCESS_KEY_ID="YOUR_ACCESS_KEY"
export AWS_SECRET_ACCESS_KEY="YOUR_SECRET_KEY"
export AWS_REGION="us-east-1"
Then start the people-time-api using your IDE or this command
./gradlew bootRun
And you can access the people-time-api and it's swagger here:
http://localhost:8084/people-time
http://localhost:8084/swagger-ui.html
There is a Postman Collection included to test the api.
Install Newman in your machine
$ npm install -g newman
newman run postman/collection.json --global-var "BPM_PEOPLE_TIME_URL=http://localhost:8084"
newman run postman/collection.json --global-var "BPM_PEOPLE_TIME_URL=$(aws cloudformation describe-stacks --stack-name bpm-people-time-api | jq -r '.Stacks | .[].Outputs | .[].OutputValue')"
Query time-templates
curl -X GET http://localhost:8084/time-templates?personId=a7c759a7-190d-47e9-baf7-ed89b4de9783
If you want to run the application from IntelliJ you must configure the required environment variables following the next steps:
Setting the environment variables
1. Go to menu Run and choose Edit Configurations.
2. It will show a configurations window. Go to the tab Configuration.
3. Add the required environment variables AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID, and AWS_REGION with the correspondent values.
Run or Debug
Now, you can run or debug the app from IntelliJ, you can use JRbel to debug and redeploy the app.
aws s3 mb s3://cf-template-spring-boot-apps-as-lambda
Generate the artifact containing the code
./gradlew buildZip
aws cloudformation package --template-file sam-people-time-api.yml --output-template-file output-sam-people-time-api.yml --s3-bucket cf-template-spring-boot-apps-as-lambda --s3-prefix people-time-api
- Deploy the code to AWS
aws cloudformation deploy --template-file output-sam-people-time-api.yml --stack-name bpm-people-time-api --capabilities CAPABILITY_IAM
- Get the URL
aws cloudformation describe-stacks --stack-name bpm-people-time-api