Audit RDS PostgreSQL parameters for drift and compliance.
Project description
PostgreSQL RDS Parameters Sync
Compare PostgreSQL settings between two databases to detect drift.
Features
Audit a particular setting
Example:
$ pgrdsparamsync audit --parameter=max_wal_size
It will get all the databases in the account and region and display their max_wal_size
value.
Since this can be an expensive operation, a local 1 hour cache is used for each parameter group.
If only a subset of databases is of interest, --db-name-like
can be used to filter based on the database name.
Example:
$ pgrdsparamsync audit --parameter=max_wal_size --db-name-like=production
It will audit only the databases that contain the string "production" in their name.
Compare a database to another or a parameter group
Example:
$ pgrdsparamsync rds-compare --target-db="users-production" --other-db="orders-production"
It will print all the settings that differ between the two databases.
If the goal is to set a standard against the entire database fleet, it is possible to compare a database to a parameter group that represents that standard.
Example:
$ pgrdsparamsync rds-compare --target-db="users-production" --parameter-group="pg-11-standard"
It will print all the settings that differ between the target database and the parameter group.
Compare two databases directly
Example:
$ pgrdsparamsync pg-compare \
--target-db-url="postgres://user:password@users-production.rds.awsamazon.com" \
--other-db-url="postgres://user:password@orders-production.rds.awsamazom.com"
RDS parameter groups use formulas to calculate certain settings (e.g. shared_buffers
, effective_cache_size
, etc.) by default. Sometimes, it is useful to know the actual value. This will connect to the databases directly, query pg_settings
, and print the settings that differ.
Caching
Fetching parameter groups for 100s of databases is long and expensive. We added a local cache with a 1h TTL. It's stored in /tmp/cache.db
. The first run of the application will be slow, but subsequent runs will be much faster.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pg_rds_params_sync-0.1a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e113a782b43f07f53357bf5b9e2d89d59df6343abcd6c367ef3feecb6643211 |
|
MD5 | db7f30f344e48782392e1f61547868bc |
|
BLAKE2b-256 | 072aacaa094310bb0cbcd3502c90f675b39ea3d140e457f78b7dbfc57c91ae15 |