简体   繁体   English

从 AWS Lambda 到 EC2 实例的 Websocket/TCP 连接?

[英]Websocket/TCP connection to an EC2 instance from AWS Lambda?

Is it possible to initiate a temporary (10 mins) Websocket/TCP connection to a server on EC2 instance from AWS Lambda?是否可以从 AWS Lambda 启动到 EC2 实例上服务器的临时(10 分钟)Websocket/TCP 连接? So that they can communicate?这样他们就可以交流了?

That's possible under a few conditions:在某些情况下这是可能的:

  • your Lambda Timeout is greater than 10 minutes你的 Lambda 超时大于 10 分钟
  • your Lambda Function is deployed into a VPC (only if the EC2 instance isn't accessible from the Inte.net)您的 Lambda Function 已部署到 VPC 中(仅当无法从 Inte.net 访问 EC2 实例时)
  • The security groups on the instance and the Lambda function allow connectivity实例上的安全组和Lambda function允许连接
  • The connection is initiated from your Lambda function (as Lambda execution contexts can't accept inbound connections)连接是从您的 Lambda function 发起的(因为 Lambda 执行上下文无法接受入站连接)

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

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