Feature request: improve return types for Secrets Manager Parameters #1409
Labels
completed
This item is complete and has been merged/shipped
feature-request
This item refers to a feature request for an existing or new utility
parameters
This item relates to the Parameters Utility
Use case
Currently when retrieving parameter values from Secrets Manager, the Parameter utility has somewhat generic return types.
For example, when calling the
getSecret
function the current return type is aPromise
that can resolve toundefined | string | Uint8Array | Record<string, unknown>
. These types were chosen because they map to the following cases:string
applies when aSecretString
value is retrieved and no transform is applied - this also applies when abase64
encoded value stored in aSecretString
is retrieved and abinary
transform is appliedUint8Array
applies when retrieving aSecretBinary
value is retrieved an no transform is appliedRecord<string, unknown>
applies whenever a transform: 'json' is applied - in this case Parameters parses the value and returns an objectundefined
is returned whenever a parameter is not foundGiven that the utility knows both the types returned by the API and the transformation to be applied, there's an opportunity to improve the return types by applying some heuristics.
Solution/User Experience
TBD
Alternative solutions
Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered: