Open
Description
Use case
- I want to store global variables so they can be fetched in multiple areas in my areas without having to explicitly passing them around into the inner functions.
- I want these variables to get cleaned automatically on every invocation
- I want to have the option to automatically add these variables the logger so they are logged. But i want to also have the option not to do that. for example: log tenant id, but dont log the user's email address.
- I want to have a simple get function to get these parameters by name.
- I'd like to have some default function getters such as tenant id, username.
Solution/User Experience
A singleton class that has several functions:
- store value - store(key: str, value: Any, should_log : bool)
- get value - get(key)
- get_tenant_id
- get_username
- store_tenant_id(tenant_id : str)
- store_username(username: str)
Alternative solutions
No response
Acknowledgment
- This feature request meets Lambda Powertools Tenets
- Should this be considered in other Lambda Powertools languages? i.e. Java, TypeScript
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Ideas