-
Notifications
You must be signed in to change notification settings - Fork 146
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
feat(parameters): ability to set maxAge
and decrypt
via environment variables
#1384
feat(parameters): ability to set maxAge
and decrypt
via environment variables
#1384
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Housekeeping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a lot of duplication with the GetOptions
class here, so opted for inheritance.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
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>
|
Great! Thanks. |
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_AGE
andPOWERTOOLS_PARAMETERS_SSM_DECRYPT
that 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 theEnvironmentVariablesService
from thecommons
package 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.