Serverless

aws-sam-local environment variables

南笙酒味 提交于 2020-01-22 13:15:45
问题 I am following the readme here: https://github.com/awslabs/aws-sam-local I have a lambda written in python 3.6 and its similar to the helloworld example here : https://github.com/awslabs/aws-sam-local/tree/develop/samples/hello-world/python template.yml looks as such: AWSTemplateFormatVersion : '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: MyFunction1 API Resources: MyFunction1: Type: AWS::Serverless::Function Properties: FunctionName: MyFunction1 Handler: lambda_module

Does teardown_appcontext ignore HTTPExceptions?

梦想与她 提交于 2020-01-16 18:26:32
问题 So, I'm trying to rollback the database session in case of an HTTP error like a bad_request, unauthorized, forbidden, or not_found happens. it is a serverless application with wsgi and flask. The scenario is: I create an entry to be saved in the database, but if something wrong happens, I want it to roll_back the session. If, I raise an exception, the rollback happens, but if I use abort(make_response(jsonify(message=message, **kwargs), 400)) an HTTPException is raised, but the teardown

Serverless Framework Login From Behind a Proxy?

时光总嘲笑我的痴心妄想 提交于 2020-01-15 11:18:53
问题 I am trying to use the serverless framework from behind a proxy. I was able to install the framework after configuring npm to use my certs file: npm config set cafile C:\path\to\certs.pem npm install serverless --global However, when I try to login to serverless I get the following error: serverless login Fetch Error -------------------------------------------- FetchError: request to https://api.serverless.com/core/tokens failed, reason: unable to get local issuer certificate at ClientRequest

Serverless Framework Login From Behind a Proxy?

廉价感情. 提交于 2020-01-15 11:17:48
问题 I am trying to use the serverless framework from behind a proxy. I was able to install the framework after configuring npm to use my certs file: npm config set cafile C:\path\to\certs.pem npm install serverless --global However, when I try to login to serverless I get the following error: serverless login Fetch Error -------------------------------------------- FetchError: request to https://api.serverless.com/core/tokens failed, reason: unable to get local issuer certificate at ClientRequest

Serverless Framework Login From Behind a Proxy?

橙三吉。 提交于 2020-01-15 11:17:08
问题 I am trying to use the serverless framework from behind a proxy. I was able to install the framework after configuring npm to use my certs file: npm config set cafile C:\path\to\certs.pem npm install serverless --global However, when I try to login to serverless I get the following error: serverless login Fetch Error -------------------------------------------- FetchError: request to https://api.serverless.com/core/tokens failed, reason: unable to get local issuer certificate at ClientRequest

How to send gzipped json response from Google Cloud Functions?

烂漫一生 提交于 2020-01-14 08:45:13
问题 My JSON responses in one of my Google Cloud Functions could be reduced up to 70-80% in size if I respond using gzip compression. How can I send a compressed json response from my Functions (trigger via http(s))? This would also mean I would save on a lot of network expenses with google cloud platform, and a faster loading of the data for mobile consumers of the data. I've tried using the zlib native module but no luck... if (req.get('Accept-Encoding') && req.get('Accept-Encoding').indexOf(

Map request into aws service without lambdas and using AWS service proxy integration on Api Gateway

倖福魔咒の 提交于 2020-01-14 06:19:59
问题 So i've got a scenario that i want to use an endpoint and map the provided requests directly into Kinesis stream. I was able to do that manually in the aws console. But is there a way to do change the integration to aws service using serverless or serverless plugin? I tried to find a way to deploy an endpoint that communicates directly with an aws service, without lambdas, and could not find it. 回答1: It's been a while but recently i noticed that there's a plugin now that helps setup this

How can I keep Google Cloud Functions warm?

隐身守侯 提交于 2020-01-09 10:06:35
问题 I know this misses the point of using Cloud Functions in the first place, but in my specific case, I'm using Cloud Functions because it's the only way I can bridge Next.js with Firebase Hosting. I don't need to make it cost-efficient, etc. With that said, the cold boot times for Cloud Functions are simply unbearable and not production-ready, averaging around 10 to 15 SECONDS for my boilerplate. I've certainly watched this video by Google (https://www.youtube.com/watch?v=IOXrwFqR6kY) that

How do I install Git using AWS Lambda?

≯℡__Kan透↙ 提交于 2020-01-05 07:37:28
问题 I have code in Code commit repository, I am writing a lambda function to build the code for every check-in (event) to the code commit repo. I am not able to install git and hence cloning the repository is not happening. How do I go about it. 回答1: As the others have mentioned installing git on lambda is either really hard or totally impossible. I did a session at reinvent about lambda and step functions and spent some time trying to get it to work. I gave up. An alternative I found more

How to call a Go Cloud Function from another Go Cloud Function in GCP

回眸只為那壹抹淺笑 提交于 2020-01-05 05:54:28
问题 Goal: I want to reuse many Go functions from two Go functions with HTTP triggers. What I have tried and steps to reproduce the problem: In GCP, create a new Go 1.11 Cloud Function, HTTP Trigger Name it: MyReusableHelloWorld In function.go , paste this: package Potatoes import ( "net/http" ) // Potatoes return potatoes func Potatoes(http.ResponseWriter, *http.Request) { } In go.mod , paste this: module example.com/foo In function to execute, paste this: Potatoes Click on deploy. It works.