Giter Site home page Giter Site logo

aws-summit-hackathon-2018's Introduction

If you are new to Serverless or want a starting point for the AWS Summit hackathon, you can use this starter project to help you get going. This repo also includes sample data which you can use in your hotel booking app. This code contains a SAM template that defines the resources in your application, starter code for a Node.js Lambda function and some instructions to get you off the ground. Feel free to use this template to get started, though you are not required to use it. You are free to use other tools or libraries that you might be already familiar with.

Getting Started

Here are the instructions to start using the starter project:

  1. Checkout the code: git clone <url> day-one-space-tours
  2. cd day-one-space-tours
  3. You will need an Amazon S3 Bucket to be able to deploy the stack. Choose a bucket name and create a bucket first using the command aws s3 mb s3://<bucketname> This bucket name must be globally unique.
  4. Open package.json in an editor and replace the <sam-package-bucket> string in the package command script with the bucket name you choose in previous step
  5. Now you are ready to get started with development. Use npm install to install required modules and start coding!

Deploying Stack

We have pre-configured simple packaging and deploying instructions in the package.json file. In order to deploy a stack, run npm run package && npm run deploy. This will upload the code from your computer to the Amazon S3 bucket you had created earlier, and call AWS CloudFormation service to deploy the stack.

Get API Gateway URL from Stack Output

  1. Open CloudFormation and sign in if you are not already logged in.
  2. In the table containing the list of stacks created, select the stack named day-one-space-tours. (If you are not able to see the stack in the console, this might usually be because of the region. Make sure that you are in the right region by checking the current region in the navigation bar)
  3. Expand the Outputs section in the stack details page, to find a table similar to the one below containing the required values | Key | Value | Description | | --- | --- | --- | | ApiBaseUrl | Base API URL value | API Gateway endpoint URL for Prod environment |

Get RDS Instance Connection Details from Stack Output

  1. Open CloudFormation and sign in if you are not already logged in.
  2. In the table containing the list of stacks created, select the stack named day-one-space-tours. (If you are not able to see the stack in the console, this might usually be because of the region. Make sure that you are in the right region by checking the current region in the navigation bar)
  3. Expand the Outputs section in the stack details page, to find a table similar to the one below containing the required values | Key | Value | Description | | --- | --- | --- | | HotelDBInstanceAddress | Address of the Hotel DB Instance | Address to connect to the MySQL Hotel DB Instance | | HotelDBInstancePort | Port number of the Hotel DB Instance | Port number to connect to the MySQL Hotel DB Instance |

Reference

  1. AWS Serverless Express: The app is built using this library which makes Express.js apps to work nicely with AWS Lambda and Amazon API Gateway. For the most part, you should be able to use regular Express.js constructs to build your frontend and backend.

General Instructions and Service Documentation Details

  1. This Serverless Application is defined using the AWS Serverless Architecture Model (SAM) Specification. Refer How to create serverless applications using AWS SAM for complete detail on creating and deploying a Serverless Application using AWS SAM.

  2. SAM is deployed using CloudFormation. SAM configuration file mainly describes the Lambda Function for processing and API Gateway for API Endpoints that fronts the Lambda Function.

  3. All logs from your Lambda Function are pushed to Amazon CloudWatch, which can be used to debug the Lambda Function. For more details refer Monitoring and Troubleshooting Lambda-based Applications.

  4. Amazon DynamoDB is a fully managed NoSQL database. The SAM template in this package creates a simple Amazon DynamoDB table. Refer to the following documentation to start using DynamoDB in your Serverless Application:

  1. Amazon Aurora is a MySQL and PostgreSQL compatible relational database built for the cloud. The SAM template in this package creates an instance running MySQL Database in it. Refer to the following documentation to work with MySQL in Amazon Aurora:

aws-summit-hackathon-2018's People

Contributors

dsflora avatar jpeddicord avatar mmobarak avatar sanathkr avatar syum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.