Aurora PostgreSQL Setup
Prerequisites
-
An AWS Aurora PostgreSQL cluster
-
A
<username>,<password>(or IAM role), cluster<endpoint>, and<database>from the DBA that hasselect,delete,update, andtruncateaccess -
libpqandpsqlpackages installed
- Ubuntu/Debian: typically uses
libpq5andpostgresql-client-common/postgresql-client-<version>packages - AWS Linux 2/Red Hat: typically uses
postgresql<version>-libsandpostgresql<version>packages
~/.aws/credentials). The AWS SDK is used to generate short-lived authentication tokens.Add the Senzing schema
Connect to the Aurora PostgreSQL cluster using the cluster writer endpoint:
psql -U <user> -d <database> -h <cluster-endpoint> -W
\i <senzing_project_path>/resources/schema/szcore-schema-postgresql-create.sql
<senzing_project_path> refers to the path specified with the /opt/senzing/er/bin/sz_create_project command when creating a project.\dt
\q
Configure the CONNECTION string
Edit the SENZING_ENGINE_CONFIGURATION_JSON environment variable or sz_engine_config.ini file :
aurorapostgresql:// URI scheme instead of postgresql://. This selects the Aurora-specific driver plugin, which handles IAM token authentication.Standard password authentication
Edit the new CONNECTION aurorapostgresql://<username>:<password>@<cluster-endpoint>:5432/<database> entry where:
5432 is the default PostgreSQL port number. Change this if the port value differs.| Parameter | Description |
|---|---|
<username> |
Aurora PostgreSQL username |
<password> |
Password for the above username |
<cluster-endpoint> |
Aurora cluster writer endpoint (for example, mycluster.cluster-xxxx.us-east-1.rds.amazonaws.com) |
5432 |
Port number of the Aurora PostgreSQL cluster |
<database> |
Database name |
IAM authentication
IAM authentication uses short-lived tokens (up to 15 minutes) generated by the AWS SDK instead of a static password. Tokens are cached process-wide and regenerated automatically when an authentication failure occurs.
aurorapostgresql://<username>@<cluster-endpoint>:5432/<database>?iam_auth=true®ion=<aws-region>
| Parameter | Description |
|---|---|
<username> |
Aurora PostgreSQL username configured for IAM authentication |
<cluster-endpoint> |
Aurora cluster writer endpoint |
iam_auth=true |
Enables IAM token authentication |
region=<aws-region> |
AWS region (for example, us-east-1). Recommended. |
region= parameter. The driver attempts to auto-detect the region from the endpoint hostname, but this may not work reliably with all Aurora endpoint formats.Example:
aurorapostgresql://[email protected]:5432/senzing?iam_auth=true®ion=us-east-1
IAM authentication prerequisites
- The Aurora cluster must have IAM database authentication enabled.
- A database user must be created and granted the
rds_iamrole:
CREATE USER senzing_user WITH LOGIN;
GRANT rds_iam TO senzing_user;
- An IAM policy must allow
rds-db:connectfor the database user. - AWS credentials must be available to the Senzing process (instance profile, environment variables, or credentials file).
Update database with the Senzing ER configuration
A Senzing instance is configured with a Senzing Entity Resolution configuration. On a fresh installation this configuration needs to be registered in the Senzing database.
If you have any questions, contact Senzing Support. Support is 100% FREE!