serverless-framework

How to use Typescript's references and build mode to compile a mono repo to a serverless bundle?

旧时模样 提交于 2019-12-06 06:45:00
Typescript recently introduced a new feature to work with monorepos: references. By specifying references you can build all interdependent packages using tsc -b (see also this blog post ) This seems ideal for use with a large mono repo where some packages are serverless services. These services typically depend on one or more packages of the monorepo. I've created an example here: https://github.com/tommedema/serverless-mono-example While building works well with tsc -b , the problem is that the serverless framework needs to upload a single artifact .zip (to AWS in my case). When building a

Serverless - Numpy - Unable to find good bind path format

萝らか妹 提交于 2019-12-05 20:00:52
I've been beating on this for over a week and been through all sorts of forum issues and posts and cannot resolve. I'm trying to package numpy in a function, individually building requirements (I have multiple functions with multiple requirements that I'd like to keep separate). Environment : Windows 10 Home Docker Toolbox for Windows : Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.4 Git commit: 0520e24302 Built: Fri Mar 23 08:31:36 2018 OS/Arch: windows/amd64 Experimental: false Orchestrator: swarm Server: Docker Engine - Community Engine: Version: 18.09.0 API version: 1.39

Can't access to RDS from Amazon Lambda, same VPC and correct role permissions

坚强是说给别人听的谎言 提交于 2019-12-05 14:46:11
i can't successfully connect to RDS from Amazon Lambda in production. For Amazon Lambda i'm using Serverless framework, executing sls offline i can connect with RDS from localhost, but in production Amazon Lambda doesn't. Both are in same VPC, in same security group, that has all traffic inbound access, and a rule that is pointing to Vpc's CIDR. I have these permissions attached: AmazonRDSFullAccess, AWSLambdaFullAccess, AmazonVPCFullAccess, AWSLambdaExecute and AWSLambdaVPCAccessExecutionRole. Thank's for help. I had this issue and the following is a summary of the steps I took to resolve: In

Access AWS Resource Outside of VPC from Within VPC - Serverless Framework

℡╲_俬逩灬. 提交于 2019-12-05 12:20:33
I am trying to access a kinesis stream outside a VPC from a lambda function inside a VPC. Currently when the code to write to the kinesis stream is executed it will hang and then timeout. When I take the lambda out of the VPC the code to write to the stream works fine. But I need to access a resource within the VPC and then write to the stream. Anyone know how to fix this? Here is my function that is in the VPC functions: handleChanges: handler: functions/handlers.handleChanges timeout: 10 package: include: - functions/utils/** events: - http: method: POST path: "/" integration: lambda vpc:

Invoking the lambda gets timed out after adding VPC configurations

痞子三分冷 提交于 2019-12-05 09:26:40
I am using serverless framework for creating lambdas. I created a simple Lambda function, which queries from an mongo instance and returns the response. Initially, I created the mongo instance with publicIp and made the Lambda access that instance with publicIP. It worked well. Now, in order to increase the security, I added the VPC configuration to the Lambda. Here is my serverless.yml: functions: graphql: handler: handler.graphql iamRoleStatements: - Effect: Allow Resource: "*" Action: - ec2:CreateNetworkInterface - ec2:DescribeNetworkInterfaces - ec2:DetachNetworkInterface - ec2

AWS Lambda Task timed out after 6.00 seconds

不打扰是莪最后的温柔 提交于 2019-12-05 04:08:52
I am using serverless framework. My Lambda function connects to DynamoDB table for updating item in table. Read & Write capacity units of table are 5 & auto_scaling is disabled. AWS Lambda function has 128MB memory allocated. I have used Jmeter for performance testing.I have sent 1000 requests concurrently and some response giving me perfect output while other giving internal server error(502 Bad Gateway). i have also analyzed cloudwatch for logs and only get Task Timeout error. can anyone suggest me why i am getting this error and how to solve it? The default timeout for AWS Lambda functions

MoonMail Lambda architecture with Serverless

泄露秘密 提交于 2019-12-05 03:48:16
I've been looking into this project because the idea of having the whole system be a collection of Lambda functions seems very appealing. As a matter of fact, a few years ago I wrote some software that does pretty much the same as MoonMail does and it is due for an update as some specs have changed. I'm evaluating porting my software to Lambda or just adapting the thing to use MoonMail. I have the following questions: In my tests using Serverless, I noticed that when I changed a resource name (like the name of a DynamoDb table) and redeployed, there was no warning and the old table and its

Deploying Universal Angular on Google Cloud Function or AWS Lambda

爱⌒轻易说出口 提交于 2019-12-04 21:04:23
问题 While experimenting with Angular 2, I happened to see Angular Universal. It's Server-side Rendering for Angular 2 apps same like we have in ReactJs. There is also a getting started guide with one code snippet here. I am trying to understand if this is something we can deploy in serverless environment like Google Cloud Function or AWS Lambda. Docs of both services indicates that nodejs is supported. I am very new to both Angular2 & serverless hosting pattern. 回答1: It is possible to deploy

How to properly connect AWS Lambda to RDS in VPC?

六眼飞鱼酱① 提交于 2019-12-04 13:03:25
I am trying to build a graphQL API with Serverless Framework on AWS-Lambda using Apollo-Server-Lambda etc. I need to use a not publicly available PostgreSQL RDS instance. I can get lambdas up and running and sending back requests when not in VPC. I can get a Postgres RDS Database up and running and connected to PgAdmin (when in publicly available mode). The problem is once I make the RDS Postgres 'non public' and try to get all these pieces talking together I fail. I have tried multitude of different approaches. This is regularly portrayed as magic. It is wonderfully written https://gist

Shared Lambda authorizer setup in Serverless Framework

本小妞迷上赌 提交于 2019-12-04 09:54:32
I am trying to create a custom Lambda authorizer that will be shared between a few different services/serverless stacks. If I understand the documentation here https://serverless.com/framework/docs/providers/aws/events/apigateway/#note-while-using-authorizers-with-shared-api-gateway , that means that I need to create a shared authorizer resource in a “common resources” service/serverless stack, and then refer to that shared authorizer from my other services. First of all: Is my understanding correct? If my understanding is correct, my next question becomes: How do I do this? The documentation