简体   繁体   English

如何为本地服务器设置AWS Lambda服务

[英]How to setup AWS Lambda service for a local server

I am trying to setup an application server for AWS Lambda but on a local network so that an application won't have to go out to the internet to execute. 我试图在本地网络上为AWS Lambda设置应用程序服务器,这样应用程序就不必走出互联网即可执行。 I would prefer to use a linux box and my programming environment is Java. 我更喜欢使用linux box,而我的编程环境是Java。

The skill from the echo will execute and then communicate with the local server rather than going out to the internet and communicating with Amazon's application server. 回声的技巧将执行,然后与本地服务器通信,而不是出入互联网并与Amazon的应用程序服务器通信。

My question is this: How do I setup the application server to handle the skill? 我的问题是:如何设置应用服务器以处理该技能? I've done the example from Amazon, do I only need to have the linux box run the Java application or is there more to the setup than that? 我已经从Amazon完成了该示例,我是否仅需要让linux框运行Java应用程序,或者设置内容还不止于此? I see there are AMIs (Amazon Machine Images) but can I deploy those locally or are they only for use on the AWS console? 我看到有AMI(Amazon机器映像),但是我可以在本地部署它们还是仅在AWS控制台上使用?

Any insight into this would be great, thank you. 对此,任何见解都会很棒,谢谢。

So this is how usual interaction between echo works: 因此,这就是echo之间通常的交互方式:

User--->Echo--->Skill--->(Internet)Applicaton server (I'm using Amazon hosted AWS lambda) User ---> Echo ---> Skill --->(Internet)Applicaton服务器(我使用的是Amazon托管的AWS lambda)

I would like to use : User--->Echo--->Skill--->(LAN)Application server (without ever using the internet). 我想使用:用户--->回声->技能->(LAN)应用程序服务器(从未使用过互联网)。

Currently I have setup echo and a skill but no application server on the LAN. 目前,我已经设置了echo和一项技能,但是LAN上没有应用服务器。 What do I need for the application server? 应用服务器需要什么? JAWS and something else? 颚和其他东西?

I'm not sure if this question is still relevant or not, but I'm using DEEP Framework to test the code locally and/or deploy it on AWS Lambda. 我不确定这个问题是否仍然有用 ,但是我正在使用DEEP Framework在本地测试代码和/或将其部署在AWS Lambda上。 Check this out: 看一下这个:

npm install deepify -g

deepify run-lambda --help

  run-lambda@1.6.8 - Run Lambda function locally 

  Usage example: deepify run-lambda path/to/the/lambda -e='{"Name":"John Doe"}' 

  Arguments:  
    path: The path to the Lambda (directory of handler itself) 

  Options:  
    --event|-e: JSON string used as the Lambda payload 
    --skip-frontend-build|-f: Skip picking up _build path from the microservices Frontend 
    --db-server|-l: Local DynamoDB server implementation (ex. LocalDynamo, Dynalite) 
    --version|-v: Prints command version 
    --help|-h: Prints command help

Also, you might want consider using the server option: 另外,您可能需要考虑使用server选项:

deepify server --help

  server@1.6.9 - Run local development server 

  Usage example: deepify server path/to/web_app -o 

  Arguments:  
    path: The path to the Lambda (directory of handler itself) 

  Options:  
    --build-path|-b: The path to the build (in order to pick up config) 
    --skip-frontend-build|-f: Skip picking up _build path from the microservices Frontend 
    --skip-backend-build|-s: Skip building backend (dependencies installation in Lambdas and linking aws-sdk) 
    --skip-build-hook|-h: Skip running build hook (hook.build.js) 
    --port|-p: Port to listen to 
    --db-server|-l: Local DynamoDB server implementation (ex. LocalDynamo, Dynalite) 
    --open-browser|-o: Open browser after the server starts 
    --version|-v: Prints command version 
    --help|-h: Prints command help 

Disclosure: I am one of the contributors to this framework 披露:我是该框架的贡献者之一

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

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