question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot change DynamoDB serverSideEncryption from true to false

See original GitHub issue

When you have already deployed a DynamoDB table with serverSideEncryption: true, you cannot change it to false. Changing it to false results in a CloudFormation deploy error. This most likely happens because AWS CDK removes the underlying CloudFormation property SSESpecification / SSEEnabled instead of setting it to false at https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-dynamodb/lib/table.ts#L1355

I have successfully changed the CloudFormation property SSESpecification / SSEEnabled: true to false when using CloudFormation directly. And I also get the same error if I try to remove the property completely.

I think AWS CDK needs some way to configure DynamoDB Tables so that the SSESpecification / SSEEnabled: false property is included in the CloudFormation stack.

PS: The reason to change serverSideEncryption to false is that it results in DEFAULT encryption being used, which doesn’t cost anything. When serverSideEncryption is true, the mode is KMS - AWS managed CMK and AWS charges you for it. At least that’s what the DynamoDB console says.

Reproduction Steps

  1. Deploy a DynamoDB table with serverSideEncryption: true
  2. Change it to serverSideEncryption: false and try to deploy the update

Error Log

CloudFormation error when deploying update:

At least one of ProvisionedThroughput, BillingMode, UpdateStreamEnabled, GlobalSecondaryIndexUpdates or SSESpecification or ReplicaUpdates is required (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException

Environment

  • CLI Version : 1.42.0 (build 3b64241)
  • Framework Version: 1.42.0
  • OS : Linux
  • Language : TypeScript

Other


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jogoldcommented, Jun 19, 2020

Has this CF behavior been updated in v15.1.0 maybe? https://github.com/aws/aws-cdk/blob/50f4a21f1b103910f029328d84347c5bfa0c7d56/packages/%40aws-cdk/cfnspec/CHANGELOG.md

  • AWS::DynamoDB::Table SSESpecification.UpdateType (changed)
    • Old: Conditional
    • New: Mutable
0reactions
kennucommented, Dec 9, 2020

I finally realized how this works. I replaced this:

      serverSideEncryption: true,

with this:

      encryption: TableEncryption.DEFAULT,

And now I’m able to restore the default encryption mode for my tables. Thanks for fixing it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DynamoDB::Table SSESpecification - AWS CloudFormation
Indicates whether server-side encryption is done using an AWS managed key or an AWS owned key. If enabled (true), server-side encryption type is...
Read more >
DynamoDB tables should be encrypted with AWS or customer ...
Although DynamoDB tables are encrypted at rest by default with AWS owned KMS keys, using AWS managed or customer managed KMS keys provides...
Read more >
aws_dynamodb_table | Resources | hashicorp/aws
Changing from true to false on a subsequent apply means replica tags are left as they were, unmanaged, not deleted. region_name - (Required)...
Read more >
aws.dynamodb.Table - Pulumi
Tag or replica changes on the global table, whether from drift or configuration changes, are propagated to replicas. Changing from true to false...
Read more >
update-table — AWS CLI 2.9.9 Command Reference
Modify the provisioned throughput settings of the table. ... Indicates whether DynamoDB Streams is enabled (true) or disabled (false) on the table.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found