-
Notifications
You must be signed in to change notification settings - Fork 407
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
Bug: parameters confusing is combining get_parameter and get_parameters results #2438
Comments
Looking at this now |
I have a couple of ideas, and will follow up tomorrow morning |
@beck3905 I'm looking at this again, and I'm wondering what's the use case that requires you to use both |
@rubenfonseca I have a config class in my code that reads all my parameters from SSM on load and adds them as attributes of my config class. The code that loads the SSM parameters reads both individual parameters by name or multiple parameters by path. It does this by wrapping the For example, let's say I have an SSM path of I ran into this issue because multiple modules will load the config class and get different values. So the first module to load the config class will go through the process above and get the correct parameter values to use locally. However, the second module to load the config class will call |
Hi @beck3905! Thanks for explaining in detail your use case and what we can to help you. We agree that we should split caching between single fetch and multi fetch to avoid errors like this one. Do you have the bandwidth to send a PR fixing this? It would be awesome to have your code contribution to the Powertools project. |
Checking in to confirm whether there's been any updates. |
Confirmed with @leandrodamascena that we were waiting for another contributor who signaled wanted to pick this one up as a learning exercise. It's a bug and we should fix it soon. If we don't hear from this contributor who wants to tackle it by EOD, I'll re-assign it and start working on this for the next release. Apologies for the delay, we got our wires crossed when prioritizing it (bug not bug?) |
Hello everyone! @paritosh16 will start working on this! |
Maintainer took over and we're releasing this fix today. Apologies on the coordination issue we had; we normally fix a bug within the same day, this was an exception. We've fixed our process issue to prevent bug fixes being dependent on non-maintainers. Thank you for the patience. |
|
This is now released under 2.22.0 version! |
Expected Behaviour
Given SSM parameters:
/foo/bar/param1
/foo/bar/param2
/foo/bar/param3
Calling
parameters.get_parameters("/foo/bar")
should return a dictionary of all 3 parameters.Calling
parameters.get_parameter("/foo/bar")
should ALWAYS raise aGetParameterError
. This error should be raised even if theget_parameter
call comes after theget_parameters
call.Current Behaviour
Given the same parameters as above:
If I call
parameters.get_parameters("/foo/bar")
all 3 parameters are cached under the parameter/foo/bar
and returned as a dictionary.If I subsequently call
parameters.get_parameter("/foo/bar")
it returns the same dictionary as theget_parameters
call instead of raising theGetParameterError
.Code snippet
Possible Solution
get_parameter
results separately fromget_parameters
results.get_parameter
orget_parameters
.Steps to Reproduce
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.9
Packaging format used
Lambda Layers
Debugging logs
No response
The text was updated successfully, but these errors were encountered: