How to mask an Amazon RDS or Aurora database for dev and test
Restore the latest snapshot into a temporary copy, mask the sensitive data in that copy, check the result, and share only the masked copy with your dev and test accounts. The live database is never touched, and developers never need access to the production account.
The steps, in the two accounts
Source account (production)
-
Snapshot
The latest snapshot is copied.
-
Check schema
The run stops if there are new columns.
-
Mask
Washery applies the policy you approved.
-
Verify
The run stops if the check finds sensitive data.
Destination account (dev or test)
Masked copy
A snapshot, a database or backup files in your dev or test account.
Why start from a snapshot and not the live database?
Restoring a snapshot puts no load on production. Masking rewrites whole tables, and those queries, and the credentials that run them, should stay away from the live database. If a mask is wrong, only the temporary copy is affected.
What has to be masked?
Every column that holds sensitive data: names, email addresses, phone numbers, street addresses, dates of birth, card numbers and government identifiers such as tax IDs and national ID numbers. Free-text columns such as notes and support tickets need a decision too, because people type sensitive data into them.
The list of columns, with the mask for each one, is the masking policy. A person has to approve it, and it has to be checked again every time the schema changes. Sensitive data usually reaches dev through a new column that nobody added to the policy.
What should masked data look like?
Masked data should look real and keep its format, so the application and its tests still work.
| Kind of data | In production, and in the masked copy |
|---|---|
| Names | Mia ChenbecomesElla Novak |
| Email addresses | mia.chen@gmail.combecomesella.novak418205993127@example.com |
| Phone numbers | 0412 880 316becomes0413 927 506 |
| Card numbers | 4871 8033 4018 7801becomes4372 6167 5136 1341 |
The masked card number still passes the card check. The same original value must also get the same masked value everywhere it appears, so foreign keys still join and unique columns stay unique. How data is masked has every kind of data. Examples show the kind of value a method writes. Every value here is made up.
How does the masked copy reach the dev account?
Share a snapshot of the masked copy with the dev account, then delete the temporary copy. Two Amazon RDS rules apply:
- A snapshot encrypted with the default
aws/rdskey cannot be shared with another account. It has to be copied with a customer managed key first. - Automated snapshots cannot be shared. Only a manual snapshot, or a manual copy of an automated one, can be.
Can AWS do this for you?
AWS gives you two ways to build it. With both, you write the masking policy yourself.
- AWS Glue. AWS published a pattern that copies and masks data between two Amazon RDS databases. The job reads the source database over JDBC and replaces sensitive values with
****. You set up three accounts, VPC peering, connections, crawlers and the job. - AWS DMS. Replication tasks in DMS 3.5.4 and later can mask columns. Digits can be replaced or randomised. Text such as names and email addresses can only be hashed, and a hash is always 64 characters. Masked columns are left out of DMS data validation.
Compare Washery with a script, AWS Glue and AWS DMS.
How Washery does it
Washery runs every step above for PostgreSQL, MySQL, MariaDB and SQL Server on Amazon RDS, and Aurora PostgreSQL and Aurora MySQL. Washery uses snapshots only. Running Washery does not impact your live database.
Washery writes the masking policy and you approve it. Washery sees column names and counts, never values.

Washery checks every masked copy before it is delivered. Washery restores the latest snapshot in an isolated network in the production account. The run stops if there are new columns, applies the policy you approved, and stops again if the check finds sensitive data.

Keeping developers out of production. Runs can be scheduled, or started and followed through the API.
In our tests a 1 GB MySQL database was masked and delivered as a shared snapshot in 41m 51s, and the run used $0.20 in AWS. Tested on 21 and 22 November 2026 on Amazon RDS, db.m5.large. Costs are what each run used in AWS, at US East (N. Virginia) list prices. See the full test report.
When is this not the right approach?
- You need every change replicated continuously. AWS DMS does that and Washery does not.
- The data is going to a data lake or a warehouse, or the database engine is not one Washery supports. AWS Glue fits better.
Sources, checked 2 December 2026: Sharing encrypted snapshots for Amazon RDS, Sharing Amazon RDS snapshots with another account, Copy and mask PII between Amazon RDS databases using AWS Glue Studio and data masking in AWS DMS.