feat(parameters): ability to set maxAge and decrypt via environment variables - #1384
Merged
dreamorosi merged 3 commits intoMar 29, 2023
Merged
Conversation
Closed
2 tasks
dreamorosi
commented
Mar 28, 2023
dreamorosi
commented
Mar 28, 2023
Contributor
Author
There was a problem hiding this comment.
Prior to this PR this method was used only in Logger. Now it's used also by Parameters so I am extracting it to the commons package to avoid duplication.
dreamorosi
commented
Mar 28, 2023
dreamorosi
commented
Mar 28, 2023
Contributor
Author
There was a problem hiding this comment.
There was a lot of duplication with the GetOptions class here, so opted for inheritance.
Contributor
Author
|
cc @heitorlessa - would like your input on env variables naming. Ideally I'd want to use the same names across runtimes so let's agree now if possible. If not, we still have time to change the names on our side before GA. |
Contributor
|
Happy with the env var name 👏
…On Wed, 29 Mar 2023 at 21:11, Alexander Schueren ***@***.***> wrote:
***@***.**** approved this pull request.
Looks good.
—
Reply to this email directly, view it on GitHub
<#1384 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBGEKBKH3YFQJMV2H6DW6SCOJANCNFSM6AAAAAAWK3EC6Y>
.
You are receiving this because you were mentioned.Message ID:
<awslabs/aws-lambda-powertools-typescript/pull/1384/review/1363785156@
github.com>
|
dreamorosi
deleted the
1380-set-maxage-and-decrypt-via-environment-variables
branch
March 29, 2023 20:01
|
Great! Thanks. |
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.
Description of your changes
This PR introduces two new environment variables to configure the behavior of the Parameters utility around caching (
maxAge) and decryption (for SSM only).Problem statement
Today the utility allows customers to configure caching and decryption via arguments passed to the utility functions or class methods. This allows to configure the retrieval and lifecycle of parameter values in a granular way.
Some customers however want to have shared settings that apply to all parameter values. For this reason we are adding two environment variables:
POWERTOOLS_PARAMETERS_MAX_AGEandPOWERTOOLS_PARAMETERS_SSM_DECRYPTthat once set will apply to all parameter retrievals.Additional info on the changes
Prior to this PR the Parameters utility was using environment variables only in one instance and only in the
AppConfigProvider. With the introduction of these new environment variables this PR adds theEnvironmentVariablesServicefrom thecommonspackage to this library. With this service the Parameters utility has now access to shared utilities that allow to read and standardize the env vars retrieval.Once merged this PR will close #1380.
Related issues, RFCs
Issue number: #1380
Checklist
Breaking change checklist
Is it a breaking change?: NO
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.