Skip to content
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: Recursive fails when using get_multiple in SSM parameters #4736

Closed
leandrodamascena opened this issue Jul 10, 2024 · 2 comments
Closed
Labels
bug Something isn't working triage Pending triage from maintainers

Comments

@leandrodamascena
Copy link
Contributor

Expected Behaviour

When attempting to retrieve multiple parameters from AWS Systems Manager (SSM) using the recursive flag, we should have access to all the parameters in a given path. If I have the parameters /leo/aa, /leo/aa/cc and /leo/aa/cc/zz, I should be able to fetch all of them by using all_parameters = ssm_provider.get_multiple("/leo", recursive=True), but this is not working.

Current Behaviour

If I have the parameters /leo/aa, /leo/aa/cc and /leo/aa/cc/zz and useall_parameters = ssm_provider.get_multiple("/leo", recursive=True), this only fetch the first level, which is aa.

Code snippet

from typing import Any

from aws_lambda_powertools.utilities import parameters
from aws_lambda_powertools.utilities.typing import LambdaContext

ssm_provider = parameters.SSMProvider()

def lambda_handler(event: dict, context: LambdaContext):

    all_parameters: Any = ssm_provider.get_multiple("/leo", recursive=False)

    for parameter, value in all_parameters.items():

        print(f"Parameter: {parameter}")
        print(f"Value: {value}")

Possible Solution

Need to pass the recursive parameter here: https://github.com/aws-powertools/powertools-lambda-python/blob/develop/aws_lambda_powertools/utilities/parameters/base.py#L210

Steps to Reproduce

Create parameters and deploy a Lambda with the provided code.

Powertools for AWS Lambda (Python) version

latest

AWS Lambda function runtime

3.12

Packaging format used

PyPi

Debugging logs

No response

@leandrodamascena leandrodamascena added bug Something isn't working triage Pending triage from maintainers labels Jul 10, 2024
@leandrodamascena
Copy link
Contributor Author

Closing this issue! I was using modified local code which impacted this test. Sorry.

Copy link
Contributor

⚠️COMMENT VISIBILITY 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 tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Pending triage from maintainers
Projects
Status: Coming soon
Development

No branches or pull requests

1 participant