Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support customer-managed keys for server_side_encryption in DynamoDB #8137

Closed
sworisbreathing opened this issue Apr 1, 2019 · 6 comments · Fixed by #11081
Closed

Support customer-managed keys for server_side_encryption in DynamoDB #8137

sworisbreathing opened this issue Apr 1, 2019 · 6 comments · Fixed by #11081
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/dynamodb Issues and PRs that pertain to the dynamodb service.
Milestone

Comments

@sworisbreathing
Copy link
Contributor

sworisbreathing commented Apr 1, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

As of November, 2018, CreateTable in DynamoDB now supports Server-Side Encryption with the use of a specific customer-managed key (as opposed to the default DynamoDB KMS master key). However, at the moment, the aws_dynamodb_table resource only supports turning SSE on/off but does not support specifying the KMS master key ID used for SSE.

Ideally, we should be able to pick which KMS key is used for encrypting data in a DDB table through the aws_dynamodb_table resource.

In my example below, I've also included sse_algorithm as I've copied it from how aws_s3_bucket works. It should be noted that per the documentation for SSESpecification, only KMS is applicable. So it's debatable whether or not terraform should expose sse_algorithm as a config option, given that only kms appears to be supported.

New or Affected Resource(s)

  • aws_dynamodb_table

Potential Terraform Configuration

resource "aws_kms_key" "mykey" {}

resource "aws_dynamodb_table" "mytable" {
  ...
  server_side_encryption {
    enabled = true
    kms_master_key_id = "${aws_kms_key.mykey.arn}"
    sse_algorithm     = "aws:kms"
  }
}

References

@sworisbreathing sworisbreathing added the enhancement Requests to existing resources that expand the functionality or scope. label Apr 1, 2019
@bflad bflad added the service/dynamodb Issues and PRs that pertain to the dynamodb service. label Apr 1, 2019
@ewbankkit
Copy link
Contributor

@sworisbreathing Thanks for this; We saw this change in the DynamoDB API about 8 months ago in the release notes for AWS SDK v1.15.16:

service/dynamodb: Updates service API and documentation
Added SSESpecification block to update-table command which allows users to modify table Server-> Side Encryption. Added two new fields (SSEType and KMSMasterKeyId) to SSESpecification block used by create-table and update-table commands. Added new SSEDescription Status value UPDATING

and I did some work in #5666 that I ultimately ended up closing as at the time the DynamoDB service didn't support the additions.
I still have the code so I will see if the service has been updated.

@ewbankkit
Copy link
Contributor

ewbankkit commented Nov 27, 2019

This has now been officially announced.
Blog post.
I will try and reuse my code from #5666.

@bflad
Copy link
Contributor

bflad commented Jan 29, 2020

Support for this functionality has been merged and will release with version 2.47.0 of the Terraform AWS Provider, tomorrow. Thanks to @ewbankkit for the implementation. 👍

@ghost
Copy link

ghost commented Jan 30, 2020

This has been released in version 2.47.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 27, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/dynamodb Issues and PRs that pertain to the dynamodb service.
Projects
None yet
3 participants