2016-01-10 120 views
1

我正在嘗試爲AWS Lambda設置應用程序服務器,但在本地網絡上,以便應用程序不必出去執行互聯網。我寧願使用Linux機器,我的編程環境是Java。如何爲本地服務器設置AWS Lambda服務

回聲的技巧將執行,然後與本地服務器通信,而不是去互聯網和與亞馬遜的應用服務器通信。

我的問題是:如何設置應用程序服務器來處理技能?我已經完成了亞馬遜的例子,我只需要讓Linux機器運行Java應用程序,還是有更多的設置比那個?我看到有AMI(亞馬遜機器映像),但是我可以在本地部署這些AMI還是僅用於AWS控制檯?

任何洞察到這將是偉大的,謝謝。

所以這是回聲之間通常互動是如何工作的:

用戶--->回聲--->技能--->(互聯網)的一個應用服務器(我使用的是亞馬遜AWS託管拉姆達)

我想用: 用戶---> Echo --->技巧--->(局域網)應用服務器(從未使用過互聯網)。

目前我在局域網上設置了回聲和技能,但沒有應用程序服務器。我需要什麼應用程序服務器? JAWS和其他東西?

+1

可能重複[如何在本地測試aws lambda函數](http://stackoverflow.com/questions/33884968/how-to-test-aws-lambda-functions-locally) – jah

+0

檢查可能的重複問題^作爲答案。目前還不清楚你想要做什麼。但是也許設置一個調用Lambda函數的API網關get/post訪問權限是您要查找的內容?如果你這樣做,你可以從任何服務器調用你的函數,無論是否本地(假設權限)。 – JohnAllen

+0

我想開發一個應用程序/技能的回聲(不測試)。但我不想使用亞馬遜的aws。他們有自己的網絡服務,但我想設置我自己的服務器,我可以在本地部署(不通過互聯網)。我正在尋找你張貼的鏈接謝謝。但我只是有點擔心,因爲它只是爲了測試。 – allegory

回答

0

我不確定這個問題是否仍然相關,但我使用DEEP Framework在本地測試代碼和/或將它部署到AWS Lambda上。檢查了這一點:

npm install deepify -g 

deepify run-lambda --help 

    [email protected] - 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 

而且,你可能要考慮使用server選項:

deepify server --help 

    [email protected] - 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 

披露:我是貢獻者之一這個框架