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

chore: Add example for custom KMS client config #440

Merged
merged 10 commits into from
Feb 9, 2023

Conversation

seebees
Copy link
Contributor

@seebees seebees commented Mar 9, 2022

Occasionally custom configuration for the AWS KMS client is needed.
This is especially important in Discovery mode,
But anytime you are dealing with more than one AWS KMS Key,
the master key providers are simpler to work with then individual master keys.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

Occasionally custom configuration for the AWS KMS client is needed.
This is especially important in Discovery mode,
But anytime you are dealing with more than one AWS KMS Key,
the master key providers are simpler to work with then individual master keys.
@seebees seebees requested a review from a team as a code owner March 9, 2022 23:25
Comment on lines +35 to +36
self._register_client(client, region_name)
self._regional_clients[region_name] = client
Copy link
Member

Choose a reason for hiding this comment

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

Just a note: IMO by including this in the official examples, this implicitly blesses these private methods as part of the public API for this class. Not sure if that's an issue or not, depending on the plans for the future of the codebase. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it may be better to refactor this example as:

main_mk = StrictAwsKmsMasterKeyProvider(providerConfig)
main_mk.add_master_key(MRKAwareKMSMasterKey(anotherConfig))

However this does not address discovery.

@alex-chew
Copy link
Contributor

This will resolve #446.

texastony
texastony previously approved these changes Nov 1, 2022
@seebees seebees changed the title doc: Add example for custom KMS client config chore: Add example for custom KMS client config Nov 1, 2022
Copy link
Contributor

@kessplas kessplas left a comment

Choose a reason for hiding this comment

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

Reapproving after syntax fixes.

@kessplas kessplas merged commit 08f305a into aws:master Feb 9, 2023
@seebees seebees deleted the custom-kms-client branch February 14, 2023 16:39
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.

7 participants