Skip to content

Docs: Improving examples for fetching secrets #5442

@chubzor

Description

@chubzor

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

  • I understand the final update might be different from my proposed suggestion, or refused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationrejected

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions