Skip to content

Covert orders file to a csv file that can be imported to Super Freight

Notifications You must be signed in to change notification settings

johnwei2019/super-freight-easy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

super-freight-easy

One lambda function that coverts the json Order file to the csv file that can be imported to the Super Freight system.

It is triggered by the SNS notification when one Order file is created in S3 Bucket. It then pulls the Order file and the store configuration file from the corresponding S3 Bucket, generates the Super Freight csv file, and upload the generated csv file back to the same S3 Bucket of the Order file.

Local development

  • Install Node JS (version 12)

  • Install dependencies

super-freight-easy$ npm install --prefix ./app ./app
  • Run tests
super-freight-easy$ npm run --prefix ./app test

Use the SAM CLI to build and test locally

Build your application with the sam build command.

super-freight-easy$ sam build

Run functions locally and invoke it with the sam local invoke command.

super-freight-easy$ sam local invoke GenerateSuperFreightCsvFunction --event events/event.json

Deployment

The Serverless Application Model Command Line Interface (SAM CLI) is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.

To use the SAM CLI, you need the following tools.

To build and deploy, run the following in your shell:

super-freight-easy$ sam build
super-freight-easy$ sam deploy --guided

The first command will build the source of the application. The second command will package and deploy the application to AWS.

About

Covert orders file to a csv file that can be imported to Super Freight

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published