Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aws-samples/aws-serverless-app-with-aurora-and-python-sql-alchemy-example
https://github.com/aws-samples/aws-serverless-app-with-aurora-and-python-sql-alchemy-example
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/aws-samples/aws-serverless-app-with-aurora-and-python-sql-alchemy-example
- Owner: aws-samples
- License: mit-0
- Created: 2021-05-10T19:09:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-24T03:04:01.000Z (over 2 years ago)
- Last Synced: 2024-05-02T13:46:51.530Z (6 months ago)
- Language: Python
- Size: 7.57 MB
- Stars: 57
- Watchers: 4
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Intro
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](https://aws.amazon.com/blogs/database/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.
![Alt text](docs/blog-sql-alchemy-solution-diagram.png?raw=true "Python SQLAlchemy in an AWS Bookstore Serverless Application")
# Prerequisites
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](https://aws.amazon.com/cli/)) configured and with permissions to deploy to the AWS account
* The [AWS Serverless Model (SAM)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) CLI
* Python 3.8
* Clone this repository into your local environment# Installing the required libraries in the Lambda Layer
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/"
```# Deploying the solution
Please check our [blog post](TODO) for details.## Security
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
## License
This library is licensed under the MIT-0 License. See the LICENSE file.