Description
Description of the feature request
Problem statement
With ES modules, developers may use top-level await within their functions. This allows developers to use the await keyword in the top level of the file. With this feature, Node.js functions may now complete asynchronous initialization code before handler invocations.
In the context of the Parameters utility, this minimises the execution time in favor of a longer and single initialisation time as parameters that are shared across invocations could be fetched ahead and used immediately when the handler is executed.
Summary of the feature
For this feature to be possible two things need to happen:
- Feature request: build as esmodule #521 must be resolved and the all the harnesses to build in ESM must be available
- e2e tests must be implemented
- docs need to make it clear that top-level async/await can be used only with ESM
Code examples
N/A
Benefits for you and the wider AWS community
Shorter execution times, simpler handler logic
Describe alternatives you've considered
Fetching all secrets in the handler's scope.
Additional context
Depending on the strategy that is decided in #521 examples should be provided in the docs for both ESM and CJS since the latter won't have access to top-level async/await.
Related issues, RFCs
Metadata
Metadata
Assignees
Labels
Type
Projects
Status