This README will provide an overview of the system architecture. It will breifly describe each component.
Note: I have used a service that can help locally developing and testing AWS projects.
Amazon API Gateway is used to create the API that the clients interacts with. It serves as the entry point for the application.
We have four lambda functions, one for each CRUD operations, create task, get task, update task, and delete task. The API gateway resource have a permission to invoke them, as well as each function having the required permissions that it needs to interact with the dynamodb table using IAM roles and policies.
This is where the tasks will be stored, currently it uses 'on-demand' capacity mode, later if we found that our requests are predictable we can change it to the provisioned capacity mode, as it will be more cost-effective.
AWS CDK used to provision the components of the system, in order to re-produce the setup, make sure you have python and the cdk cli installed and follow those instructions
git clone https://github.com/mohamedhafizelhaj/AWS-Serverless-CRUD-Task.git
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cdk synzth
cdk bootstrap aws://{account_id}/{region}
cdk deploy
Note that currently I am hardcoding the logical resource names in the infrastructure test file for simplicity, if you would like to run the tests, you should replace them with your resource names found in the synthesized cloudformation template, after that run
pytest tests/unit