Skip to content

LG-10342 Add the ability to specify a key_id for the KMS Client#8945

Merged
jmhooper merged 2 commits intomainfrom
jmhooper-mr-kms-client
Aug 8, 2023
Merged

LG-10342 Add the ability to specify a key_id for the KMS Client#8945
jmhooper merged 2 commits intomainfrom
jmhooper-mr-kms-client

Conversation

@jmhooper
Copy link
Contributor

@jmhooper jmhooper commented Aug 7, 2023

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.

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]
Copy link
Contributor

@soniaconnolly soniaconnolly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add a spec for this being enabled/disabled, or does that come later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will come later


attr_reader :kms_key_id

def initialize(kms_key_id: IdentityConfig.store.aws_kms_key_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we update AwsKmsClientHelper too to accept a key_id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client helper already accepts a key ID argument for the mapped results. I added the key ID for the single operation stub.

@jmhooper jmhooper merged commit cf0ddd3 into main Aug 8, 2023
@jmhooper jmhooper deleted the jmhooper-mr-kms-client branch August 8, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants