I have a few tables already existing in DynamoDB. Some of them are empty and some may have a few test records.
I am trying to add a new kms cmk to one of these existing tables using the code below in python.
table_encryption_key= kms.Key(
self, "kms-cmk",
alias= "myapp/appkey/cmk",
description= "CMK for encrypting existing DynamoDB table",
enabled= True,
removal_policy= RemovalPolicy.RETAIN,
key_spec= kms.KeySpec.SYMMETRIC_DEFAULT
)
table_ref = dynamodb.TableV2.from_table_name(
self, "table_name_rd", "rd_store"
)
table_ref.encryption = dynamodb.TableEncryption.CUSTOMER_MANAGED
table_ref.encryption_key = table_encryption_key
I get the error can’t set attribute 'encryption_key'
This what I am referring to for documentation. What am I missing?