【问题标题】:Is it possible to connect an AWS Lambda function without a VPC connection to AWS EFS?是否可以在没有 VPC 连接的情况下将 AWS Lambda 函数连接到 AWS EFS?
【发布时间】:2020-12-19 17:59:40
【问题描述】:

我想将 AWS EFS 连接到我的 AWS Lambda 函数,而不将 Lambda 函数连接到 VPC。可以这样做吗?

【问题讨论】:

  • 我不这么认为。 Amazon EFS 文件系统专门链接到 VPC,因此 Lambda 函数需要同一个 VPC 中才能访问 EFS 文件系统。
  • 短 - 没有。 Long -documentation 状态 Lambda functions that access EFS must run from within a VPC. EFS 是基于网络协议的,所以 lambda 需要网络

标签: amazon-web-services aws-lambda amazon-efs


【解决方案1】:

这简直是不行。这是不可能的。

EFS file systems are always created within a customer VPC, so Lambda functions using the EFS file system must all reside in the same VPC.

就像这里所说的 (https://aws.amazon.com/blogs/compute/using-amazon-efs-for-aws-lambda-in-your-serverless-applications) Lambda 应放置在创建 EFS 的同一 VPC 中。

您不喜欢将 Lambda 函数放在 VPC 中可能有不同的原因:

  • 初始化非常慢(创建 ENI,将 Lambda 附加到它。这需要很长时间)
  • 要放置在 VPC 等中的其他配置。

一种解决方案是使用 Lambda 的预配置并发功能(它会带来更多成本) 通过这种方式,您可以随时通过保温来准备好多个 Lambda 函数。

干杯

【讨论】:

    猜你喜欢
    • 2019-01-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-04
    • 2021-03-17
    • 1970-01-01
    • 2020-02-12
    • 2021-01-07
    相关资源
    最近更新 更多