Key | Value |
---|---|
Services | Lambda, DynamoDB, Event Bridge |
Integrations | AWS SDK, AWS CLI, GitHub actions, pytest |
Categories | Serverless, DynamoDB, LocalStack developer endpoints, Python |
Level | Intermediate |
This app queries DockerHub to get the number of pulls and stars for a given image. This information is stored in a DynamoDB table, indexed by the query time. The app is deployed as an AWS Lambda function and uses the AWS SDK to interact with DynamoDB. A Event Bridge is used to trigger the Lambda function each minute. The app is tested using pytest and awslocal using the localstack docker container.
LocalStack cli and docker container
create a virtual environment and install the requirements
pip install -r requirements-dev.txt
pre-commit install
commit-linter
-
Start localstack
localstack start
-
Deploy the lambda function and provision the DynamoDB table
sh bin/deploy.sh
-
run unit tests
make test
-
run integration tests:
make integration-test
-
GitHub actions CI tests
.github/workflows/test-integration-localstack.yaml