Giter Club home page Giter Club logo

localstack-workshop's Introduction

Build Status

LocalStack Workshop

Repository with code samples for the LocalStack workshop.

Note: The project can either be cloned and installed on your local machine, or you can spin up a remote development environment (Gitpod, or Github Codespaces) to access the project directly from your browser.

  • Option 1: Open the project in Github Codespaces
  • Option 2: Open the project in Gitpod
  • Option 3: Run the project locally (see instructions below)

Prerequisites

Installation & Getting Started

LocalStack can be started in different ways. The easiest way (the one we recommend) is through the LocalStack CLI.

First, install the LocalStack command-line interface (CLI):

pip install localstack

Then we can simply start the LocalStack container locally:

export LOCALSTACK_API_KEY=... # insert your API key here
DEBUG=1 localstack start

Once LocalStack is running in the Docker container, we can issue CLI commands to create and interact with AWS resources. Let's say, for instance, that we want to create a S3 bucket. If you have the AWS Command Line Interface installed on your machine, you can simply type:

aws --endpoint=http://localhost.localstack.cloud:4566 s3 mb s3://demo-bucket

To make things simpler, you might want to install awslocal, i.e., our wrapper around the AWS CLI. This way, you don't need to set up the endpoint for every CLI command. The previous command would just be:

awslocal s3 mb s3://demo-bucket

You can create and browse resources in LocalStack also from the research browser. Simply, go to our Web App, log in, and click on Resources in the top navigation bar. You will gain access to our research browser, where each service has a console to manage its resources.

Hello World

Every programming language tutorial starts with printing a Hello World. Let us have the equivalent in LocalStack.

Sample 1: Deploy a Serverless App on LocalStack

As the next step, we'll deploy a serverless application using Lambda, S3, SNS, and other AWS services. This is an app to resize images uploaded to an S3 bucket, using Lambda functions and event-driven processing. A simple web fronted using HTML and JavaScript provides a way for users to upload images that are resized and listed.

Sample 3: Infrastructure-as-Code Tools and Containerized Applications

We mostly interacted with LocalStack through the CLI so far. However, large systems are hardly built this way. Luckily, LocalStack supports a wide range of integrations that will cover your favorite Infrastructure-as-Code (IaC) tool. In the following sample, we will deploy a containerized application (using ECS, Cognito, etc) with either Terraform or CloudFormation.

Sample 4: AppSync GraphQL APIs for DynamoDB and RDS Aurora PostgreSQL

In this sample, we'll take a closer look at AppSync, a managed services for deploying GraphQL APIs to access data sources like RDS databases or DynamoDB tables. The AppSync GraphQL sample is a simple application that maintaines entries in a database table, and makes them accessible via a GraphQL HTTP endpoint. Clients can also subscribe to a WebSocket endpoint to receive real-time updates about new DB entries. The stack is defined via CDK, and deployed fully locally against LocalStack.

Sample 5: Cloud Pods

Details following soon...

localstack-workshop's People

Contributors

whummer avatar alexrashed avatar giograno avatar viren-nadkarni 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.