Repository navigation
Closed
Labels
Description
Expected Behaviour
Follow the example in https://docs.aws.amazon.com/powertools/python/latest/utilities/parameters/#fetching-parameters, when call get_parameters_by_name with more than 10 existed parameters, it should return all those parameters.
Current Behaviour
Return only the last chunk of parameters
Code snippet
from aws_lambda_powertools.utilities.parameters import ssm
params = {
"/dev/param1": {},
"/dev/param2": {},
"/dev/param3": {},
"/dev/param4": {},
"/dev/param5": {},
"/dev/param6": {},
"/dev/param7": {},
"/dev/param8": {},
"/dev/param9": {},
"/dev/param10": {},
"/dev/param11": {},
"/dev/param12": {},
}
response, errors = ssm.get_parameters_by_name(params)
print("Final fetched parameters:", response)
# Actual results: only param11, param12 returned
# Expected results: all params returnedPossible Solution
Bug in method _get_parameters_by_name_in_chunks
powertools-lambda-python/aws_lambda_powertools/utilities/parameters/ssm.py
Lines 572 to 594 in a104ede
| def _get_parameters_by_name_in_chunks( | |
| self, | |
| batch: dict[str, dict], | |
| cache: dict[str, Any], | |
| raise_on_error: bool, | |
| decrypt: bool = False, | |
| ) -> tuple[dict, list]: | |
| """Take out differences from cache and batch, slice it and fetch from SSM""" | |
| response: dict[str, Any] = {} | |
| errors: list[str] = [] | |
| diff = {key: value for key, value in batch.items() if key not in cache} | |
| for chunk in slice_dictionary(data=diff, chunk_size=self._MAX_GET_PARAMETERS_ITEM): | |
| response, possible_errors = self._get_parameters_by_name( | |
| parameters=chunk, | |
| raise_on_error=raise_on_error, | |
| decrypt=decrypt, | |
| ) | |
| response.update(response) | |
| errors.extend(possible_errors) | |
| return response, errors |
The response variable in line 580 is overridden by the line 586
Steps to Reproduce
See the code snippet
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.13
Packaging format used
PyPi
Debugging logs
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsComing soon
Activity
boring-cyborg commentedon Dec 18, 2025
Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link
anafalcao commentedon Jan 12, 2026
Hey @tuanpt-0634! Thanks for the detailed issue, and thank you for your patience, the team was mostly out for the holiday season. I was also able to replicate this behavior, so I'll move this to the backlog.
Would you like to open a PR with the fix?
fix(parameters): accumulate results across chunks in get_parameters_b…
fix(parameters): fix variable shadowing in SSM parameter chunking
powertools-for-aws-oss-automation commentedon Feb 25, 2026
Warning
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either reopen the issue, or open a new issue referencing this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
github-actions commentedon Mar 12, 2026
This is now released under 3.25.0 version!