serverless-framework

Cannot debug serverless application in Visual Studio Code

我的未来我决定 提交于 2019-11-30 14:53:46
问题 I have tried to debug serverless application developed using serverless framework in VS code. I have followed this article. But when I trying to debug the code I'm getting an error from VS code as below. Cannot launch program 'g:\Projects\Serverless1\node_modules.bin\sls'; setting the 'outDir or outFiles' attribute might help. sls command file already exists in the folder and following are the launch.json file settings "version": "0.2.0", "configurations": [ { "type": "node", "request":

Cannot debug serverless application in Visual Studio Code

Deadly 提交于 2019-11-30 12:45:26
I have tried to debug serverless application developed using serverless framework in VS code. I have followed this article. But when I trying to debug the code I'm getting an error from VS code as below. Cannot launch program 'g:\Projects\Serverless1\node_modules.bin\sls'; setting the 'outDir or outFiles' attribute might help. sls command file already exists in the folder and following are the launch.json file settings "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "protocol": "inspector", "name": "run hello function", "program": "${workspaceRoot}\\node_modules\

Rename an Azure Function

江枫思渺然 提交于 2019-11-30 04:10:48
How to rename an Azure Function ? I want to replace a default 'HttpTriggerCSharp1' name to my own. At the moment unfortunately this name is included in the function url and there is no option to change it: https://functions-xxx.azurewebsites.net/api/HttpTriggerCSharp1 4c74356b41 The UI does not directly support renaming a Function, but you can work around this using the following manual steps: Stop your Function App. To do this, go under Function app settings / Go To App Service Settings, and click on the Stop button. Go to Kudu Console: Function app settings / Go to Kudu (article about that )

How should I connect to a Redis instance from an AWS Lambda function?

丶灬走出姿态 提交于 2019-11-29 22:29:38
I'm trying to build an API for a single-page web app using AWS Lambda and the Serverless Framework . I want to use Redis Cloud for storage, mostly for its combination of speed and data persistence. I may use more Redis Cloud features in the future, so I'd prefer to avoid using ElastiCache for this. My Redis Cloud instance is running in the same AWS region as my function. I have a function called related that takes a hashtag from a GET request to an API endpoint, and checks to see if there's an entry for it in the database. If it's there, it should return the results immediately. If not, it

How to import Python dependencies in Serverless v1.0

﹥>﹥吖頭↗ 提交于 2019-11-29 10:39:09
Language: Python Framework: Serverless v1.0 Typically I would run pip freeze > requirements.txt in the project root How can I get these dependencies packaged into every deploy? Benny Bauer create requirements.txt pip freeze > requirements.txt create a folder with all the dependencies: pip install -t vendored -r requirements.txt Note that in order to use these dependencies in the code you'll need to add the following: import os import sys here = os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path.join(here, "./vendored")) See https://stackoverflow.com/a/36944792/1111215 for

Serverless Framework - Python and Requirements.txt

。_饼干妹妹 提交于 2019-11-29 10:12:05
Using the serverless framework v1.0.0, I have a 'requirements.txt' in my service root with the contents being the list of dependant python packages. (e.g. requests). However my resulting deployed function fails as it seems these dependencies are not installed as part of the packaging 'Unable to import module 'handler': No module named requests' I assume it is serverless that does the pip install, but my resulting zip file is small and clearly its not doing it, either by design or my fault as I am missing something? Is it because its Lambda that does this? If so what am I missing?) Is there

How to test aws lambda functions locally

让人想犯罪 __ 提交于 2019-11-29 05:28:42
I have a mobile application backend developed with node.js express. I tried it to deploy it as lambda service. For that I created a Serverless Framework project ( https://github.com/serverless ). Previously I tested mobile app locally by starting express backend application. Now I can't find a method to test my mobile app locally without local backend. jaws run command only run once I called it. Is there any method to start the lambda function as a web service? Or is there any alternative to Serverless Framework? It doesn't look like there's way to do this right now, but version 1.4.0 is about

Lambda Integration vs. Lambda Proxy: Pros and Cons

梦想的初衷 提交于 2019-11-28 18:39:52
What do you think are the Pros and Cons of using Lambda integration with and without the proxy feature in AWS API Gateway (and more specifically, when using the Serverless framework)? Here's what I think up to now: Lambda Integration with Proxy Pro : One can rapidly prototype and code without worrying about all the needed configuration details (and reinventing a few wheels like generic template mappings, etc). Pro : It's really easy to return any status code and custom headers, while at the same time there's a generic way to read the body, headers, parameters, of the request. Con : Everything

Lambda Integration vs. Lambda Proxy: Pros and Cons

余生长醉 提交于 2019-11-27 20:12:53
问题 What do you think are the Pros and Cons of using Lambda integration with and without the proxy feature in AWS API Gateway (and more specifically, when using the Serverless framework)? Here's what I think up to now: Lambda Integration with Proxy Pro : One can rapidly prototype and code without worrying about all the needed configuration details (and reinventing a few wheels like generic template mappings, etc). Pro : It's really easy to return any status code and custom headers, while at the

How should I connect to a Redis instance from an AWS Lambda function?

大兔子大兔子 提交于 2019-11-27 10:36:44
问题 I'm trying to build an API for a single-page web app using AWS Lambda and the Serverless Framework. I want to use Redis Cloud for storage, mostly for its combination of speed and data persistence. I may use more Redis Cloud features in the future, so I'd prefer to avoid using ElastiCache for this. My Redis Cloud instance is running in the same AWS region as my function. I have a function called related that takes a hashtag from a GET request to an API endpoint, and checks to see if there's an