A simple calculator application that works between AWS services with GitHub Actions for ci/cd.
- Two functions app that work between each other
- CI / CD
We require to store reference for the user calculation file.
Hash Key: userId Range Key: timestamp || latest
reference: string createdAt: string
REQUEST: POST
VALIDATION: {
firstNumber: string
secondNumber: string
userName: string
}
- Calculate function checks for validity of input data of POST request.
- Send a SQS Message to a CALCULATION_QUEUE name/queue url.
- A lambda that handles the SQS messages and sums the numbers up.
- Save results in S3 for specific user.
- Stores reference to these results file in DynamoDB.
- Uses userId as PK and sortKey of either
timestamp
orlatest
- When creating a record, we will have to make 2 item updates:
- Put: one item sortKey as timestamp
- Put: one item sortKey as latest
- Uses userId as PK and sortKey of either
- We receive a
GET
request withuserId
as parameter. - Search dynamoDB acces for that userId. Get the reference to results.
- Fetch results from S3 document, parse them and return response as JSON.