GithubHelp home page GithubHelp logo

localstack-demo's Introduction

localstack with serverless demo

This is somewhat of a contrived application that demonstrates how localstack can be used in conjunction with serverless and cloudformation for local development of AWS components:

Environment setup

yarn local:up

architecture

# tear down localstack docker container
yarn local:down

Testing

yarn dev

yarn test

query API

# clear S3, SQS and Dynamo
yarn purge

Localstack command samples

SNS

awslocal sns list-topics

awslocal sns publish --topic-arn "arn:aws:sns:us-east-1:000000000000:image-created" --message 'test image created message'

awslocal sns publish --topic-arn "arn:aws:sns:us-east-1:000000000000:image-updated" --message 'test image updated message'

SQS

awslocal sqs list-queues

awslocal sqs send-message --message-body="{}" --queue-url "http://localhost:4566/queue/test"

awslocal sqs receive-message --queue-url "http://localhost:4566/queue/test" --max-number-of-messages 10

awslocal sqs delete-message --queue-url "http://localhost:4566/queue/test" --receipt-handle <handle>

awslocal sqs send-message --message-body="test-dlq" --queue-url "http://localhost:4566/queue/imports"

awslocal sqs receive-message --queue-url "http://localhost:4566/queue/imports-dlq" --max-number-of-messages 10

S3

awslocal s3api list-buckets

awslocal s3 cp test/test-dynamo-record.json s3://images

awslocal s3api list-objects --bucket images

Bucket content is available here, using the image hash as the slug to get a specific image, e.g.

Dynamo DB

awslocal dynamodb list-tables

awslocal dynamodb put-item \
 --table-name images \
 --item file://test/test-dynamo-record.json \
 --return-consumed-capacity TOTAL \
 --return-item-collection-metrics SIZE

awslocal dynamodb scan --table-name images

awslocal dynamodbstreams list-streams

localstack-demo's People

Contributors

garyalway avatar

Stargazers

Michael Corrado avatar Roman avatar

Forkers

gaybro8777

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.