Git Product home page Git Product logo

rbramwell / mockaws Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wongcyrus/mockaws

0.0 3.0 0.0 6 KB

Mock AWS is docker-compose project template that simulate 3 common services in AWS serverless architecture: Lambda, DynamoDB, and S3. And, our use case is mainly for students to try and learn how to use node.js to build serverless services, but it can be extended for your local lambda code development or testing.

JavaScript 100.00%

mockaws's Introduction

#Mock AWS Mock AWS is docker-compose project template that simulates 3 common services in AWS serverless architecture: Lambda, DynamoDB, and S3. And, our use case is mainly for students to try and learn how to use node.js to build serverless services, but it can be extended for your local lambda code development or testing.

##Start Mock AWS Environment docker-compose up

4 containers will start in the following sequence s3 & dynamodb => preprocessing => lambda

Preprocessing can let you create bucket in S3 and table in DynamoBD.

##Check Result

Keep the s3 and dynamodb container running Go to http://localhost:8000/shell/ to inspect the result.

You can check created table with

+++++++++++++++++++++++++++++++++++++++++++++++++++

var params = {}; dynamodb.listTables(params, function(err, data) { if (err) console.log(JSON.stringify(err, null, 2)); else console.log(JSON.stringify(data, null, 2)); });

+++++++++++++++++++++++++++++++++++++++++++++++++++

You can check the data in Music table

+++++++++++++++++++++++++++++++++++++++++++++++++++

var params = { TableName: "Music", KeyConditionExpression: "Artist = :artist", ExpressionAttributeValues: { ":artist": "No One You Know" } };

dynamodb.query(params, function(err, data) { if (err) console.log(JSON.stringify(err, null, 2)); else console.log(JSON.stringify(data, null, 2)); });

+++++++++++++++++++++++++++++++++++++++++++++++++++

You can check S3 folder for the files.

##Stop Mock AWS Environment Stop the cluster

Ctrl + C

docker-compose down

##Cleanup

Delete S3 and DB folders.

mockaws's People

Contributors

wongcyrus avatar

Watchers

James Cloos avatar Rory Bramwell avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.