You're right. As in the case, the setting will not work, since KMS keys cannot be shared between regions.
Let's say you copy data from region R1 to R2, which have KMS keys K1 and K2, respectively. I can offer the following options:
- Modify the library slightly so that it decrypts data from R1 using K1 and re-encrypts using K2 during replication. You will be interested in the DynamoDBStreamsRecordTransformer class.
- Import your own key material in both R1 and R2. Check the relevant documentation here .
- Caution: it can be painfully operative, depending on your use case.
Update : adding your thoughts so that it helps someone stumble on this question in the future:
- Create your own plaintext key (possibly using the KMS GenerateRandom API), encrypt it using K1 and K2 (using the Encrypt API) and save as received cypher texts along with your data in both regions.
- Caution: calls throughout the region for each update. In option # 1, updates are asynchronous.
source share