Implementation of a simple mathematical combination algorithm where the order of the elements in the grouping does not interfere with the result. The algorithm runs on the architecture of Lambda AWS functions.
- AWS CLI already configured with at least PowerUser permission
- Java SE Development Kit 8 installed
- Docker installed
- Maven
- SAM CLI
Use maven
to install our dependencies and package our application into a JAR file:
cd Combination/
mvn clean package
Invoking function locally through local API Gateway
- Start the SAM local API.
sam build --template combination.yaml
sam package --output-template-file packaged.yaml --s3-bucket <some bucket name>
sam local start-api
If the previous command ran successfully you should now be able to hit the following local endpoint to
invoke the functions rooted at http://localhost:3000/combination
Request Example:
curl --location --request POST 'http://localhost:3000/combination' \
--header 'Content-Type: application/json' \
--data-raw '{
"p": "2",
"n": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
}'
Next, you can use the following resources to know more about beyond hello world samples and how others structure their Serverless applications: