serverless-framework

Use AppSync and Amazon RDS with serverless-graphql

点点圈 提交于 2019-12-12 13:40:30
问题 There is this great repository with example implementations of different serverless scenarios. Right now I'm struggling with the combination of AppSync and Amazon RDS. I tried the implementation of the standalone rds, and the appsync examples provided in the repository. These are working like a charm. But obviously there are many differences and difficulties if you'd like to combine these technologies. I used the schema, resolver and handler functions from the rds directory and combined it

How to remove serverless dashboard?

大兔子大兔子 提交于 2019-12-11 18:01:01
问题 I've decided to try the new Serverless framework dashboard and now I just can't get rid of it. It's getting my CloudWatch logs and asking me to be logged in to be able to deploy, it's so annoying! Does anyone know how to remove it? I can only find how to install it on their docs... 回答1: Solved this issue by removing the app and org option son the serverless.yml file. org: foo app: foo-bar-api service: foo-bar-api ... 来源: https://stackoverflow.com/questions/57972248/how-to-remove-serverless

Getting double quotes when returning html

我怕爱的太早我们不能终老 提交于 2019-12-11 15:54:23
问题 I have below route to return privacy policy for my app. const html = `<html><body><div>dsfdsfsfdsfsfsdfdsf</div></body></html>` const handler = (request, reply) => { try { return reply(html) } catch (err) { return reply({ success: false, message: err.message, data: [] }) } } const routeConfig = { method: 'GET', path: '/privacy-policy', config: { description: 'Creates a task.', notes: ['On success, returns { "data": [ { "tasks" } ]}'], handler } } However when I am returning the html content I

403 Forbidden when trying to upload PDF as blob to S3 bucket using PUT

做~自己de王妃 提交于 2019-12-11 12:25:36
问题 What I'm Trying to Do Upload a PDF file from a browser client without exposing any credentials or anything unsavory. Based on this, I thought it could be done, but it doesn't seem to work for me. The premise is: you request a pre-signed URL from an S3 Bucket based on a set of parameters supplied to a function that is part of the JavaScript AWS SDK you supply this URL to the frontend, which can use it to place a file in the S3 Bucket without needing to use any credentials or authentication on

AWS Lambda connect via PG.js to RDS Postgres database (connection made, no timeout, but no database?)

血红的双手。 提交于 2019-12-11 11:55:46
问题 I have my lambda function is trying to connect to an RDS PostGreSQL DB. Since I use https://serverless.com/ to deploy the function (sets up my cloudfront) it puts the LF in a separate VPC from the RDS DB. Not a big issue. If you read: https://docs.aws.amazon.com/lambda/latest/dg/services-rds-tutorial.html you see you can setup the serverless.yml file (as below) with the subnet, and security Group IDs, and then give a role to the Lambda Function that has AWSLambdaVPCAccessExecutionRole (I gave

GCloud: Debug “function crashed out of request scope”

无人久伴 提交于 2019-12-11 05:27:38
问题 I'm running a GCloud function , which seems to crash silently , without any kind of error trace. Everything works perfectly in the emulator but crashes when running on GCloud ! The following message shows up in the function's logs: Error: function crashed out of request scope Function killed. Any idea on how to debug this? 回答1: I think this issue has to do with what you are returning, and how you returning it. In the production environment, if you do not properly return a promise your

How to locally run my cloudflare worker serverless function, during development?

有些话、适合烂在心里 提交于 2019-12-11 04:37:47
问题 I managed to deploy my first cloudflare worker using serverless framework according to https://serverless.com/framework/docs/providers/cloudflare/guide/ and it is working when I hit the cloud. During development, would like to be able to test on http://localhost:8080/* What is the simplest way to bring up a local http server and handle my requests using function specified in serverless.yml? I looked into https://github.com/serverless/examples/tree/master/google-node-simple-http-endpoint but

AWS serverless function is not responding with an image

倖福魔咒の 提交于 2019-12-11 04:13:02
问题 I'm trying to have AWS API Gateway respond back with an image. My Serverless Lambda code is the following const express = require('express'); const serverless = require('serverless-http'); const bodyParser = require('body-parser'); const request = require('request'); const fetch = require('node-fetch') var Jimp = require('jimp'); const app = express() app.use(bodyParser.json()) app.use(bodyParser.urlencoded({ extended: true })) app.get('/image/:id', async(req, res) => { const id = req.params

Serverless framework won't start with dynamodb local

浪子不回头ぞ 提交于 2019-12-11 02:44:21
问题 EDIT: As answered below by Carlos, this was a bug with serverless-dynamodb-local version 0.2.23 (version as of this edit is 0.2.35). It has now been resolved and if you are experiencing a similar issue you should update your dependencies. I had a working dev environment of an AWS Lambda function developed on the Serverless framework, using DynamoDB (plugins: serverless-offline, serverless-dynamodb-local . After deleting node_modules and reinstalling, I have lost the ability to start the

GCloud Functions debugging deployment failure

风流意气都作罢 提交于 2019-12-11 01:48:43
问题 Just started using GCloud Functions today, and I am having a problem. I've updated one of my projects to be function-ready and used google's local-emulator (@google-cloud/functions-emulator) to debug and test my new function. Everything went well and emulator deployment went just fine. ``` $ functions deploy doThing --trigger-http --timeout=540s Copying file:///var/folders/nw/.../T/us-central1-doThing-....zip... Waiting for operation to finish...done. Deploying function.......done. Function