AWS lambda 函数在检索 AWS 机密时是否进行一些缓存

Is AWS lambda function doing some caching when it retrieves an AWS secret

我注意到当我更新秘密时,lambda 需要一些时间才能检索更新后的秘密值。我想知道在 lambda 调用期间是否发生了一些缓存。

我在 lambda 函数中知道的唯一内置缓存是执行上下文重用,记录在案 here

Take advantage of execution context reuse to improve the performance of your function. Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the /tmp directory. Subsequent invocations processed by the same instance of your function can reuse these resources. This saves execution time and cost.

回答你的问题,如果你在函数处理程序之外获取秘密,那么在执行上下文中完全更新需要一些时间。