Serverless

Serverless offline not getting route

∥☆過路亽.° 提交于 2020-01-04 04:08:09
问题 I have a serverless project that I just newly initialized: severless.yml : service: lambda provider: name: aws runtime: nodejs8.10 region: us-east-1 functions: hello: handler: handler.hello events: - http: path: /hello method: GET plugins: - serverless-offline And I run it with sls offline --port 8080 : Serverless: Starting Offline: dev/us-east-1 Serverless: Routes for hello: Serverless: GET /hello Serverless: Offline listening on http://localhost:8080 and in my handler.ts module.exports

Serverless WARNING: Could not determine version of module babel-runtime

泪湿孤枕 提交于 2020-01-02 04:55:11
问题 I'm running sls deploy and getting the following warning that spams many lines. Serverless: WARNING: Could not determine version of module babel-runtime Serverless: WARNING: Could not determine version of module babel-runtime Serverless: WARNING: Could not determine version of module babel-runtime Serverless: WARNING: Could not determine version of module babel-runtime Serverless: WARNING: Could not determine version of module babel-runtime ... What is the cause of this warning, should I be

API Gateway HTTP Proxy integration with serverless-offline (NOT Lambda Proxy)

瘦欲@ 提交于 2019-12-31 02:24:07
问题 I am trying to use serverless-offline to develop / simulate my API Gateway locally. My API gateway makes liberal use of the HTTP proxy integrations. The production Resource looks like this: I have created a serverless-offline configuration based on a few documents and discussion which say that it is possible to define an HTTP Proxy integration using Cloud Formation configuration: httpProxyWithApiGateway.md - Setting an HTTP Proxy on API Gateway by using Serverless framework. Setting an HTTP

Scalable in-order message processing on Azure serverless

谁都会走 提交于 2019-12-24 20:02:46
问题 I need to create something on Azure that can process incoming streams of messages for a set of entities. We will have anywhere between 20 and 2,000 entities at any point in time; these get created and discarded dynamically. Messages will be generated using our on-premises system, and sent to Azure using some queueing mechanism. Each message will be associated with a specific entity through an EntityId property. Messages belonging to the same entity must be processed in-order with respect to

Proper way of registering 3rd party DI Framework (Lamar/Autofac) on Azure functions V2

元气小坏坏 提交于 2019-12-24 09:29:10
问题 Azure Functions V2 now supports .net dependency injection In order to achieve that you need to do the following code: [assembly: FunctionsStartup(typeof(MyNamespace.Startup))] namespace MyNamespace { public class Startup : FunctionsStartup { public override void Configure(IFunctionsHostBuilder builder) { builder.Services.AddHttpClient(); builder.Services.AddSingleton((s) => { return new CosmosClient(Environment.GetEnvironmentVariable("COSMOSDB_CONNECTIONSTRING")); }); builder.Services

Apollo Server, Graphql - Must provide query string

杀马特。学长 韩版系。学妹 提交于 2019-12-24 03:25:10
问题 Im not sure what im doing wrong here? I've been stuck now for soem time on getting my mutations to run with my apollo-server-lambda in my serverless setup, my queries works fine bu when i try to run a query like this: { "mutation": "{ signIn(username: \"SomeUser\", password: \"SomePassword\" ) { token } }" } I just get the message: " Must provide query string." status 400. I've set up my resolver like so: const resolvers = { Query: { users: async (_, args, ctx) => User.load(args, ctx) },

Serverless Cron Job firing twice

人盡茶涼 提交于 2019-12-24 00:46:21
问题 I am not sure why but my webhook is being fired twice in my cron job. So this cron job is suppose to run once every 15 min which it does, but it is firing off twice. I will post the logs, handler and yml file to help out. Basically my cron job will make some request to a salsify api to store a url inside a mongodb. Once that file has been completed and built the next time the cron job runs it should trigger the webhook for netlify. Then the process starts all over again. In my netlify I

How to get stack output from AWS SAM?

大憨熊 提交于 2019-12-23 16:43:19
问题 I would like to perform automatic integration tests on my serverless projects. To do that, I need to get the api endpoints somehow. There is already the plugin serverless-stack-output for Serverless framework that serves the purpose. But I'm wondering how can I achieve similar thing by AWS SAM after I deploy my application? Meanwhile, If I can somehow get my api's base url as well as individual endpoints, then I'm able to connect them and and perform tests against them. 回答1: As AWS SAM builds

Destroy resources created via Serverless without destroying Lambda endpoints

匆匆过客 提交于 2019-12-23 09:28:01
问题 I have the following resource defined in my serverless.yml file. Its working great to create the resource for all my different stages of development. resources: Resources: uploadBucket: Type: AWS::S3::Bucket Properties: BucketName: ${self:service}-${self:custom.stage}-uploads visitsTable: Type: AWS::DynamoDB::Table Properties: TableName: ${self:custom.visitsTable} AttributeDefinitions: - AttributeName: userId AttributeType: S - AttributeName: visitId AttributeType: S KeySchema: -

How to describe AWS Lambda function test events in CloudFormation template?

不羁的心 提交于 2019-12-23 07:15:30
问题 I describe existing AWS Lambda function in CloudFormation template and I face with the next issue. In our Lambda we configured few test events which helps us to verify some usecases (I mean functionality from the screenshot below). But I don't see any abilities to add these test events to the CloudFormation template. AWS documentation don't help me with that. Is that possible at all or are there any workarounds how to export and import Lambda function test events? 回答1: Lambda test