- Project Description
- Project Structure
- Requirements
- Installation
- Running the Lambda Function Locally
- Running the Unit Tests
- Additional Notes
- Contribution
- License
This project consists of a solution that checks if the SLA of a set of folders and files has been triggered, and then sends this information to a REST endpoint. This information will be ingested into a DynamoDB table using an architecture based on AWS Lambda and DynamoDB.
architecture
: Contains the architecture diagram for the lambda processslaFiles.ps1
: Contains the powershell process to get the SLA Files that will be trigger to the Lambda.src/awsLambda.py
: Contains the Lambda function that processes the events and writes to DynamoDB.src/awsLambdaTest.py
: Contains the unit tests for the Lambda function using themoto
library to mock DynamoDB.requirements.txt
: List of dependencies needed for the project.README.md
: This file, containing instructions on how to set up and run the project.
- Python 3.7 or higher
- pip (Python package installer)
-
Clone this repository to your local machine:
git clone https://link_to_repository.git cd architecture
-
Create a virtual environment and install the dependencies:
pip install -r requirements.txt
To test the Lambda function locally, you can execute the lambda_process.py
script with a test event:
```python
python awsLambda.py event.json
```
To run the unit tests, make sure you are in the root directory of the project and execute:
```python
python -m unittest awsLambdaTest.py
```
This will run the tests in test_lambda_process.py, using moto to mock DynamoDB.
AWS Credentials: You do not need AWS credentials to run the tests, as moto mocks AWS services. Moto: Moto is a library that allows mocking AWS services for unit testing. This is useful for developing and testing without needing access to the real cloud.
If you wish to contribute to this project, please follow these steps:
Fork the project Create a new branch (git checkout -b feature/new-feature) Make your changes and commit them (git commit -am 'Add new feature') Push your branch (git push origin feature/new-feature) Create a new Pull Request
This project is licensed.