简体   繁体   English

是否可以在没有 VPC 连接到 AWS EFS 的情况下连接 AWS Lambda function?

[英]Is it possible to connect an AWS Lambda function without a VPC connection to AWS EFS?

I want to connect AWS EFS to my AWS Lambda function, without connecting the Lambda function to VPC.我想将 AWS EFS 连接到我的 AWS Lambda function,而不将 Lambda ZC1C425268E68385D1AB5074 连接到 VPCF。 Is it possible to do this?是否有可能做到这一点?

This is simply No. It's impossible.这简直是不。这是不可能的。

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.

Like stated here ( https://aws.amazon.com/blogs/compute/using-amazon-efs-for-aws-lambda-in-your-serverless-applications ) Lambda should be placed within same VPC where EFS is created.如此处所述( https://aws.amazon.com/blogs/compute/using-amazon-efs-for-aws-lambda-in-your-serverless-applications )Lambda 应放置在创建 EFS 的同一 VPC 中。

There might be different reasons you didn't like to place your Lambda function in VPC:您不喜欢将 Lambda function 放在 VPC 中可能有不同的原因:

  • Very slow initialization (Creating ENI, Attaching Lambda to it.. This takes long time significantly)初始化非常慢(创建 ENI,将 Lambda 附加到它。这需要很长时间)
  • Additional configuration to place in VPC etc..要放置在 VPC 等中的附加配置。

One solution is to use provisioned concurrency feature of Lambda (It comes with more costing) In this way, you can get multiple Lambda functions ready to use any time by keeping it warm.一种解决方案是使用 Lambda 的预置并发功能(成本更高)这样,您可以随时通过保持温暖来获得多个 Lambda 功能。

Cheers干杯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM