1- # aurora-data-api - A Python DB-API 2.0 client for the AWS Aurora Serverless Data API
1+ aurora-data-api - A Python DB-API 2.0 client for the AWS Aurora Serverless Data API
2+ ===================================================================================
23
34Installation
45------------
@@ -9,18 +10,21 @@ Installation
910Prerequisites
1011-------------
1112* Set up an
12- [ AWS Aurora Serverless cluster]( https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html)
13+ ` AWS Aurora Serverless cluster < https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html >`_
1314 and enable Data API access for it. If you have previously set up an Aurora Serverless cluster, you can enable Data API
1415 with the following `AWS CLI <https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html >`_ command::
1516
1617 aws rds modify-db-cluster --db-cluster-identifier DB_CLUSTER_NAME --enable-http-endpoint --apply-immediately
1718
1819* Save the database credentials in
19- [ AWS Secrets Manager]( https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html) using a format expected
20- by the Data API (a JSON object with the keys ``username `` and ``password ``)::
20+ ` AWS Secrets Manager < https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html >`_ using a format
21+ expected by the Data API (a JSON object with the keys ``username `` and ``password ``)::
2122
2223 aws secretsmanager put-secret-value --secret-id MY_DB_CREDENTIALS --secret-string "$(jq -n '.username=env.PGUSER | .password=env.PGPASSWORD')"
2324
25+ * Configure your AWS command line credentials using
26+ `standard AWS conventions <https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html >`_.
27+
2428Usage
2529-----
2630Use this module as you would use any DB-API compatible driver module. The ``aurora_data_api.connect() `` method is
@@ -43,14 +47,20 @@ the standard main entry point, and accepts two implementation-specific keyword a
4347
4448 Motivation
4549----------
46- The `RDS Data API <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html >`_ is the missing link
47- between the AWS Lambda serverless environment and the sophisticated features provided by PostgreSQL and MySQL. The Data
48- API tunnels SQL over HTTP, eliminating the need to use a traditional database driver
50+ The `RDS Data API <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html >`_ is the link between the
51+ AWS Lambda serverless environment and the sophisticated features provided by PostgreSQL and MySQL. The Data API tunnels
52+ SQL over HTTP, which has advantages in the context of AWS Lambda:
4953
54+ * It eliminates the need to open database ports to the AWS Lambda public IP address pool
55+ * It uses stateless HTTP connections instead of stateful internal TCP connection pools used by most database drivers
56+ (the stateful pools become invalid after going through
57+ `AWS Lambda freeze-thaw cycles <https://docs.aws.amazon.com/lambda/latest/dg/running-lambda-code.html >`_, causing
58+ connection errors and burdening the database server with abandoned invalid connections)
59+ * It uses AWS role-based authentication, eliminating the need for the Lambda to handle database credentials directly
5060
5161Links
5262-----
53- * `Project home page (GitHub) <https://github.com/chanzuckerberg >`_
63+ * `Project home page (GitHub) <https://github.com/chanzuckerberg/aurora-data-api >`_
5464* `Documentation (Read the Docs) <https://aurora-data-api.readthedocs.io/en/latest/ >`_
5565* `Package distribution (PyPI) <https://pypi.python.org/pypi/aurora-data-api >`_
5666* `Change log <https://github.com/chanzuckerberg/aurora-data-api/blob/master/Changes.rst >`_
0 commit comments