feat: allow KMS encryption of token environment variable #83
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.
This commit adds support for encrypting the
OBSERVE_TOKEN
environment variable in transit.Previously, this module accepted a
kms_key_arn
variable which affected all environment variables at rest. However, this still exposed the token in different contexts (e.g. AWS Config). We now allow reusing the KMS key to encrypt the variable, which gets decrypted by our lambda as of versionv1.0.20240501
.This commit also introduces a subtle API change to the module. We pass in an object,
kms_key
, rather than a string,kms_key_arn
. This is more friendly to thecount
operator, which cannot determine the value of an attribute until apply time.