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 organizations-api using your IDE or this command
./gradlew bootRun
And you can access the organizations-api and it's swagger here:
http://localhost:8085/organizations
http://localhost:8085/swagger-ui.html
There is a Postman Collection included to test the api.
Install Newman in your machine
$ npm install -g newman
You can run it with newman with this command:
newman run postman/collection.json -e postman/env.json
So far you can create, query and delete people using the API.
Query organizations
curl -X GET http://localhost:8085/organizations
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.
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-organizations-api.yml --output-template-file output-sam-organizations-api.yml --s3-bucket cf-template-spring-boot-apps-as-lambda --s3-prefix organizations-api
- Deploy the code to AWS
aws cloudformation deploy --template-file output-sam-organizations-api.yml --stack-name bpm-organizations-api --capabilities CAPABILITY_IAM
- Get the URL
aws cloudformation describe-stacks --stack-name bpm-organizations-api