0

I'm following the aws cdk workshop

The last pytest from the advanced topics throws:

AttributeError: module 'aws_cdk.aws_dynamodb' has no attribute 'TableEncryption'

What did I miss?

self._table = ddb.Table(
    self, 'Hits',
    partition_key={'name': 'path', 'type': ddb.AttributeType.STRING},
    encryption=ddb.TableEncryption.AWS_MANAGED,
)

.

pip3 freeze | grep dynamodb

aws-cdk.aws-dynamodb==1.23.0
jjk
  • 592
  • 1
  • 6
  • 23

1 Answers1

1

CDK version 1.23.0 didn't have TableEncryption.

It's there in the latest version (1.134.0 as of today). It wasn't there in 1.23.0.

Based on the blame log it was added with https://github.com/aws/aws-cdk/pull/7425. Based on the changelog this PR was merged in for version 1.39.0.

You are on a very old version of CDK. It's a year and a half old. You should upgrade.

kichik
  • 33,220
  • 7
  • 94
  • 114
  • @jjk This answer is better than mine. I misread your locked CDK version as 1.123, not the ancient 1.23. – fedonev Dec 20 '21 at 10:56