Open chubzor opened 4 hours ago
I wanted to set up pulling secrets for my project and replacing my custom code with lambda power tools parameters functionality.
https://docs.powertools.aws.dev/lambda/python/latest/utilities/parameters/#fetching-secrets
The example has api_key: Any = parameters.get_secret("/lambda-powertools/api-key") headers: dict = {"X-API-Key": api_key}
api_key: Any = parameters.get_secret("/lambda-powertools/api-key") headers: dict = {"X-API-Key": api_key}
This reads as pulling a value for an api-key key But the value of api-key can be a mapping of keys and values and produce a dict.
In my code I've set up secrets where I've got project-name/staging
Under that I have key value mapping of: DB_CONNECTION_STRING API_KEY
And wanted to do: parameters.get_secret("project-name/staging/DB_CONNECTION_STRING") to pull the value under a key within a secret.
Adding another nested example to show the difference between a plain string and key/value results.
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
What were you searching in the docs?
I wanted to set up pulling secrets for my project and replacing my custom code with lambda power tools parameters functionality.
Is this related to an existing documentation section?
https://docs.powertools.aws.dev/lambda/python/latest/utilities/parameters/#fetching-secrets
How can we improve?
The example has
api_key: Any = parameters.get_secret("/lambda-powertools/api-key") headers: dict = {"X-API-Key": api_key}
This reads as pulling a value for an api-key key But the value of api-key can be a mapping of keys and values and produce a dict.
In my code I've set up secrets where I've got project-name/staging
Under that I have key value mapping of: DB_CONNECTION_STRING API_KEY
And wanted to do: parameters.get_secret("project-name/staging/DB_CONNECTION_STRING") to pull the value under a key within a secret.
Got a suggestion in mind?
Adding another nested example to show the difference between a plain string and key/value results.
Acknowledgment