"SAM Local Invoke" 支持 EFS 吗?

Does "SAM Local Invoke" support EFS?

我正在使用 Lambda 访问 EFS,如 https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html

所述

lambda 函数在 AWS 中 运行 时工作正常,但在通过“本地调用”命令使用 SAM 时它会失败。错误是

2020-10-02T20:03:19.389Z        09b6f1b2-d80a-15e1-9531-f74182e95c1e    ERROR   Invoke Error    
{
   "errorType":"Error",
   "errorMessage":"ENOENT: no such file or directory, open '/mnt/efs/newfile.txt'",
   "code":"ENOENT",
   "errno":-2,
   "syscall":"open",
   "path":"/mnt/efs/newfile.txt",
   "stack":[
      "Error: ENOENT: no such file or directory, open '/mnt/efs/newfile.txt'",
      "    at Object.openSync (fs.js:458:3)",
      "    at Object.writeFileSync (fs.js:1355:35)",
      "    at WriteFile (/var/task/src/apis/permissions/isallowed.js:70:8)",
      "    at IsAllowedInPolicy (/var/task/src/apis/permissions/isallowed.js:52:5)",
      "    at Runtime.exports.handler (/var/task/src/apis/permissions/isallowed.js:16:28)",
      "    at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"
   ]
}

“sam local invoke”应该与 EFS 一起使用吗?

答案是否定的

我向 AWS 申请了支持票,有人告诉我

This is a limitation on the AWS SAM CLI and not your configuration. Therefore, I have taken the initiative to submit an internal feature request with our internal service team(specifically AWS SAM CLI service team) on your behalf and I have added your company name and voice to this request. At the moment, we would not be able to provide an estimate on if or when this feature will be supported. I would advise to check the AWS announcement page from time to time for future service updates. https://aws.amazon.com/new/

我还发现有人提交了feature request on GitHub as a workaround