Open mpalmer opened 3 years ago
Because we needed this feature in a hurry, I've put together a fairly minimal provider that does a generateDataKeyWithoutPlaintext
and stores it in the manner I described previously. So, until this feature gets implemented in this provider, interested parties can use https://registry.terraform.io/providers/cipherstash/kms.
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
This issue is still relevant, as far as I am aware.
Community Note
Description
KMS has the ability to generate what it calls "data keys", which are symmetric keys guaranteed to be generated suitably randomly, and encrypted with the specified KMS key.
We've identified a situation in which it would be extremely useful to generate a data key from within Terraform (to hand to an external system that is already using some Terraform state). However that doesn't appear to be possible at present with the AWS Terraform provider.
New or Affected Resource(s)
For our purposes, we'd need:
aws_data_key_without_plaintext
However for completeness, you'd probably also want to implement:
aws_data_key
aws_data_key_pair
aws_data_key_pair_without_plaintext
I expect these would all work similarly to how the
random_password
resource works: generate a new data key if one doesn't already exist, or if the value of somekeeper
-type parameter changes, otherwise remember the previously-generated data key and keep giving it back on each run.Potential Terraform Configuration
References