You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These examples demonstrate a complete migration path from the legacy AWS DynamoDB Encryption Client Python library to the new AWS Database Encryption SDK for DynamoDB.
4
+
5
+
## Overview
6
+
7
+
The migration process is demonstrated through a series of example steps that show how to gradually transition from the legacy client to the new SDK while maintaining compatibility with previously encrypted data.
8
+
9
+
## Migration Steps
10
+
11
+
### Step 0: Legacy DynamoDB Encryption Client
12
+
13
+
[migration_step_0.py](./ddbec/migration_step_0.py) demonstrates using the legacy DynamoDB Encryption Client to encrypt and decrypt items. This represents the starting point for migration.
14
+
15
+
Key concepts:
16
+
17
+
- Setting up the legacy client with an AWS KMS cryptographic materials provider
18
+
- Defining attribute actions for encryption/signing
19
+
- Storing and retrieving encrypted items
20
+
21
+
### Step 1: AWS Database Encryption SDK with Legacy Override
22
+
23
+
[migration_step_1.py](./awsdbe/migration_step_1.py) demonstrates how to start using the AWS Database Encryption SDK with a pre-existing table used with the DynamoDB Encryption Client.
24
+
25
+
Key concepts:
26
+
27
+
- Configure AWS DBESDK to read items encrypted in the legacy format
28
+
- Continue to encrypt items in the legacy format (FORCE_LEGACY_ENCRYPT_ALLOW_DECRYPT policy)
29
+
- Read items encrypted in the new format
30
+
- Deploy this step to all readers before moving to step 2
31
+
32
+
### Step 2: Full Migration to AWS Database Encryption SDK
33
+
34
+
[migration_step_2.py](./awsdbe/migration_step_2.py) demonstrates the next step in the migration process, using both the pure AWS DBESDK client and the legacy-override client side by side.
35
+
36
+
Key concepts:
37
+
38
+
- Create a pure AWS DBESDK client for new data
39
+
- Keep using legacy-override client when needed for legacy data
40
+
- Re-encrypt legacy data with the new client
41
+
- Demonstrate that the legacy-override client can read both formats
42
+
43
+
### Step 3: Complete Migration - Using Only AWS DBESDK
44
+
45
+
[migration_step_3.py](./awsdbe/migration_step_3.py) demonstrates the final state of the migration, where all data has been re-encrypted using the new format.
46
+
47
+
Key concepts:
48
+
49
+
- Use only the pure AWS DBESDK client (no more legacy override)
50
+
- Verify all previously re-encrypted data is readable
51
+
- Add new data using the pure client
52
+
53
+
## Prerequisites
54
+
55
+
Before running these examples:
56
+
57
+
1. Replace `common.KMS_KEY_ID` with a valid AWS KMS key ID or alias
58
+
2. Ensure you have AWS credentials configured with permissions for:
- These examples create a real DynamoDB table and perform actual AWS KMS operations, which may incur AWS charges
68
+
- By default, the examples leave the created table intact when they finish - uncomment the table deletion code in the example scripts if you want to clean up resources
69
+
- These examples are focused on demonstrating a migration path and are not production-ready code
0 commit comments