RDS Encryptor
Overview
RDS Encryptor is a CLI tool that automates the encryption of Amazon RDS instances for SOC2 and CMMC compliance. The tool performs the following steps:
- Creates a snapshot of the existing RDS instance.
- Encrypts the snapshot using a specified AWS KMS key.
- Restores a new RDS instance from the encrypted snapshot.
- Configures DMS (AWS Database Migration Service) to migrate data.
- Sets up and executes replication tasks to transfer data from the source to the encrypted instance.
Features
- Automated RDS Encryption: Encrypts an RDS instance with a KMS key.
- DMS Integration: Uses AWS DMS for seamless data migration.
- Replication Support: Maintains database consistency during migration.
- Parameter Group Management: Ensures correct settings for logical replication.
Installation
pip install rds-encryptor
Requirements
- Created dms replication instance and kms key before running the tool. How to choose correct replication instance class?
Usage
Run the tool using the CLI:
rds-encryptor \
--rds-instance-name my-rds-instance \
--master-password mypassword \
--kms-key-arn my-kms-key \
--dms-replication-instance-arn my-dms-replication \
--databases db1 db2 \
--new-instance-identifier new-encrypted-instance
CLI Arguments
| Argument | Short | Description |
|---|---|---|
--rds-instance-name |
-r |
Source RDS instance ID |
--master-password |
-p |
Master password for authentication |
--kms-key-arn |
-k |
KMS key ARN for encryption |
--dms-replication-instance-arn |
-i |
DMS replication instance ARN |
--databases |
-d |
List of databases to encrypt and migrate |
--new-instance-identifier |
-n |
Identifier for the new encrypted instance |
Workflow
1. Validate Database Connections
Ensures the tool can connect to the source RDS instance before starting encryption.
2. Create Encrypted RDS Instance
- Takes a snapshot of the existing instance.
- Encrypts it using the specified KMS key.
- Creates a new RDS instance from the encrypted snapshot.
3. Configure Parameter Groups
- Adjusts
wal_sender_timeout. - Enables
pglogicalinshared_preload_libraries. - Ensures
rds.logical_replicationis enabled.
4. Setup Database Migration
- Configures DMS endpoints.
- Creates replication tasks for each database.
- Truncates the target database before migration.
5. Execute Migration
- Runs the DMS replication tasks.
- Ensures sequences and IDs are correctly migrated.
Logging
Logs are generated throughout the process, helping track the migration progress and any potential issues.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Metadata
Release files for rds-encryptor 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rds_encryptor-1.0.2.tar.gz | 27.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rds_encryptor-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.3 kB
Release files / rds_encryptor-1.0.2.tar.gz
| Download URL | rds_encryptor-1.0.2.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24e6370745d37d167c52041f5c0022c83744d576ae64427262e2359daeaaa4bb
|
|
BLAKE2b-256 checksum How to use checksums |
8d38beaf0584fbcdd0a87035cae9a71dff9f6542fc6c394e978e72fb764c839a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2025.
Transparency logRelease files / rds_encryptor-1.0.2-py3-none-any.whl
| Download URL | rds_encryptor-1.0.2-py3-none-any.whl |
|---|---|
| Size | 30.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1bdef64dea9cbef005778e38f80025702f344ca875b676ba49db8f2e7e6cc4cc
|
|
BLAKE2b-256 checksum How to use checksums |
ec984563501576426ba347a562d361c25daf2dff9d34db162c6c12faef03dd5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 3, 2025.
Transparency log