Feature request: improve return types for SSM Parameters #1386
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
Milestone
Use case
Currently when retrieving parameter values from AWS SSM Parameter Store, the Parameter utility has somewhat generic return types.
For example, when calling the
getParameter
function the current return type isstring, Record<string, unknown>, undefined
. These types were chosen because they map to the following cases:string
applies in most cases since SSM supports string values onlyRecord<string, unknown>
applies whenever atransform: 'json'
is applied - in this case Parameters parses the value and returns anobject
undefined
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
With improved return types, the
getParameter
(as well class-based correspondent and potentially thegetParameters
), users should be able to obtain stronger typing:Additionally, you can check this TS Playground.
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: