AWS Lambda


#1

Wanted to see if anyone is using lambda’s with Moltin. I have started making some and will be sharing them soon, but wanted to see what other people’s experiences have been working with them.

-George


#2

One example might be this Algolia connector, to import your Moltin product data into Algolia! https://github.com/matthew1809/Algolia-moltin


#3

hi @GeorgeF im starting the same process, trying to build a lambda, do you have any advice to start doing it, can you share your experience.

many thanks in advanced


#4

Hey @sebastian11c

We have a collection of AWS and Zeit lambdas on GitHub.com/moltin-examples that integrate with Moltin. We’re working on ways to enable these quicker, but right now you should follow the GitHub repos.

Hopefully these help. Let me know if you need any pointers.


#5

Hey Sebatian,

That’s awesome, ya been loving working with Moltin via serverless environment. Some quick notes.

Using serverless framework. Great tool for making triggers and llambda setup. (also note sls in terminal :), instead of serverless for commands)


Example yml set up

service: accounts-service

provider:
  name: aws
  runtime: nodejs8.10

functions:
  tax:
    handler: handler.accounts
    events:
      - http:
          path: accounts
          method: get
          cors: true

Note about this, need nodejs8.10 if you want to use async/await.

Shoot out to Jamie because I have switched over to using the request-SDK

const { createClient: MoltinClient } = require("@moltin/request");

const client = new MoltinClient({
  client_id: "XXXXX",
  client_secret: "XXXXX"
});

Then a call is like

      const accounts = await client.get('customers')

These projects have a basic html playground so you can play around with the API easily.

For logging, I have just been using cloudwatch.

Would love to chat about what your thinking and would be happy to run through it with you.

-George


#6

thanks @GeorgeF for all the information.