jjk
jjk

Reputation: 595

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

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

Upvotes: 0

Views: 437

Answers (1)

kichik
kichik

Reputation: 34724

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.

Upvotes: 1

Related Questions