Docs: Improving examples for fetching secrets #5442
Labels
documentation
Improvements or additions to documentation
need-more-information
Pending information to continue
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
The text was updated successfully, but these errors were encountered: