LG-10342 Add the ability to specify a key_id for the KMS Client#8945
Merged
LG-10342 Add the ability to specify a key_id for the KMS Client#8945
Conversation
We are migrating to a new KMS instance for encryption that supports multi-region keys. We will need to encrypt and decrypt ciphertexts with both the current single region key and the new multi-region key. To support that the KMS client will need to be able to be configured for one of the given keys. This commit adds the ability to specify a key ID to use for the KMS client. To preserve the original behavior as the new key is being phased in the KMS client uses the old single region key if no key is specified. [skip changelog]
soniaconnolly
approved these changes
Aug 7, 2023
Contributor
soniaconnolly
left a comment
There was a problem hiding this comment.
LGTM, one spec query.
| config.add(:aws_kms_client_multi_pool_size, type: :integer) | ||
| config.add(:aws_kms_key_id, type: :string) | ||
| config.add(:aws_kms_multi_region_key_id, type: :string) | ||
| config.add(:aws_kms_multi_region_write_enabled, type: :boolean) |
Contributor
There was a problem hiding this comment.
Do you want to add a spec for this being enabled/disabled, or does that come later?
Contributor
Author
There was a problem hiding this comment.
That will come later
zachmargolis
reviewed
Aug 7, 2023
|
|
||
| attr_reader :kms_key_id | ||
|
|
||
| def initialize(kms_key_id: IdentityConfig.store.aws_kms_key_id) |
Contributor
There was a problem hiding this comment.
can we update AwsKmsClientHelper too to accept a key_id?
Contributor
Author
There was a problem hiding this comment.
The client helper already accepts a key ID argument for the mapped results. I added the key ID for the single operation stub.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We are migrating to a new KMS instance for encryption that supports multi-region keys. We will need to encrypt and decrypt ciphertexts with both the current single region key and the new multi-region key. To support that the KMS client will need to be able to be configured for one of the given keys.
This commit adds the ability to specify a key ID to use for the KMS client. To preserve the original behavior as the new key is being phased in the KMS client uses the old single region key if no key is specified.