This project is companion source code to the AWS Database blog post: Use Python SQLAlchemy ORM to interact with an Amazon Aurora database from a serverless application. Please read the blog post for details.
In the diagram below, we depict the AWS architecture discussed in the blog as a reference. The various components depicted in the architecture can be deployed using the code in this repository.
In order to deploy the solution in this repository you'll need the following:
- An AWS account
- The latest version of the AWS Command Line Interface (AWS CLI) configured and with permissions to deploy to the AWS account
- The AWS Serverless Model (SAM) CLI
- Python 3.8
- Clone this repository into your local environment
This project uses Lambda functions that depend on libraries deployed to a Lambda layer. So, the first step is to make sure these libraries are installed properly in the Lambda layer.
Run the commands below in a sandbox environment similar to your Lambda function's environment. This is required as package psycopg2-binary
is OS-dependent. If you prefer, you can use a Docker image for that (e.g., https://hub.docker.com/r/lambci/lambda/).
cd db_schema/db_schema_lambda_layer/
python -m pip install -r requirements.txt -t "python/"
Please check our blog post for details.
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.