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
# DyanmoDb Encryption Client to AWS Database Encryption SDK for DynamoDb Migration
2
2
3
-
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.
3
+
This projects demonstrates the three Steps necessary to migration to the AWS Database Encryption SDK for DynamoDb
4
+
if you are currently using the DynamoDb Encryption Client.
4
5
5
-
## Overview
6
+
[Step 0](./ddbec/README.md) demonstrates the starting state for your system.
6
7
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
+
## Step 1
8
9
9
-
## Migration Steps
10
+
In Step 1, you update your system to do the following:
10
11
11
-
### Step 0: Legacy DynamoDB Encryption Client
12
+
- continue to read items in the old format
13
+
- continue to write items in the old format
14
+
- prepare to read items in the new format
12
15
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.
16
+
When you deploy changes in Step 1, you should not expect any behavior change in your system,
17
+
and your dataset still consists of data written in the old format.
14
18
15
-
Key concepts:
19
+
You must ensure that the changes in Step 1 make it to all your reads before you proceed to step 2.
16
20
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
21
+
## Step 2
20
22
21
-
###Step 1: AWS Database Encryption SDK with Legacy Override
23
+
In Step 2, you update your system to do the following:
22
24
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.
25
+
- continue to read items in the old format
26
+
- start writing items in the new format
27
+
- continue to read items in the new format
24
28
25
-
Key concepts:
29
+
When you deploy changes in Step 2, you are introducing a new encryption format to your system,
30
+
and must make sure that all your readers are updated with the changes from Step 1.
26
31
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
32
+
Before you move onto the next step, you will need to re-encrypt all old items in your dataset
33
+
to use the newest format. How you will want to do this, and how long you may want to remain in this Step,
34
+
depends on your system and your desired security properties for old and new items.
31
35
32
-
###Step 2: Full Migration to AWS Database Encryption SDK
36
+
## Step 3
33
37
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.
38
+
Once all old items are re-encrypted to use the new format,
39
+
you may update your system to do the following:
35
40
36
-
Key concepts:
41
+
- continue to write items in the new format
42
+
- continue to read items in the new format
43
+
- do not accept reading items in the old format
37
44
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
45
+
Once you have deployed these changes to your system, you have completed migration.
0 commit comments