🛠️ AWS SAM-CLI [Lambda, S3, DynamoDB]
- Ivan Luna
- Python , AWS , AWS SAM-CLI , DynamoDB , Backend Development , AWS Deployment , AWS S3 , AWS Lambda
- 01 Nov, 2024
A Serverless solution template built using AWS SAM, Lambda, DynamoDB, and S3.
About this project:
This is a serverless solution template built using AWS SAM, Lambda, DynamoDB, and S3. This application is designed to efficiently process and analyze text data in a scalable manner.
Prerequisites
To set up the application, ensure you have the following installed and configured:
- AWS CLI: Command Line Interface for managing AWS services.
- SAM CLI: AWS Serverless Application Model Command Line Interface for building and deploying serverless applications.
- Python 3.12: The programming language used for the Lambda functions.
- AWS Account: An active AWS account is required to deploy the application.
Installation Steps
Follow these steps to set up the application locally:
-
Clone the Repository
git clone <repository-url> cd <repository-directory>
-
Create a Virtual Environment
python -m venv venv source venv/bin/activate On Windows use `venv\Scripts\activate`
-
Install Dependencies
pip install -r requirements.txt
-
Configure Environment Variables Create a .env file in the root of your project and define the necessary environment variables.
-
Set Up AWS Credentials
aws configure set aws_access_key_id your_access_key aws configure set aws_secret_access_key your_secret_key aws configure set region your_region
Deployment
sam deploy --guided
This command will guide you through the deployment process, prompting you for necessary parameters such as stack name, AWS region, and confirmation to create IAM roles.
Testing
Run the following commands to execute tests:
-Integration Tests: To run integration tests, execute:
pytest -v tests/integration/test_lambda_integration.py
Contributing
Contributions are welcome! Please submit a pull request or open an issue for any suggestions or improvements.