The Complete AWS Boilerplate

Re-Create any Internet Company by copying this Cloud Boilerplate for Startups

Kangze Huang
Dec 29, 2018 Β· 7 min read

Want to re-make Netflix? How about AirBnb and Zillow? This boilerplate is for rapidly building the backends of modern internet businesses using AWS. Everything from A to Z πŸ˜‚

πŸŽ‰ ~ Welcome to The Complete AWS Boilerplate ~ πŸŽ‰

This is the Official 2019 Edition written by Kangzeroo (see original 2017 here). It is based on the practical knowledge I’ve gained from building many products in my own startup, RentHero. This tutorial series shows you step-by-step how to set-up and connect your backends on the AWS Cloud (with screenshots). It is meant to be easy to understand and skips the unnecessary details. Our focus is gettings things done fast and done right. πŸ†

Who Is This For?

This is NOT for system admins looking to pass the official AWS Certificate Exam. This boilerplate is for:

  • CTOs πŸ€“
  • Startup developers πŸ’ͺ
  • Enterprise developers reading startup stuff on their spare time πŸ˜‰
  • Non-programmers curious to see what the AWS Cloud is capable of 😱

What Can I Expect?

I made this boilerplate to be a 10X β€œforce multiplier” for small teams, so you can expect to gain 6 months of knowledge in 2 weeks. We’ll focus on:

  • Core AWS Services and their Use Cases
  • Foundational Security from Day 1
  • Pro-Tips for Rapid Iteration

This boilerplate helps you achieve 10X results by letting you:

  • Skip the learning curves
  • Copy boilerplate code
  • Enjoy a free 30% productivity boost* by using Javascript on the frontend and backend (*not actually 30%, that’s just an expression I like to use)
  • Let Amazon do the heavy lifting

Excited yet?

The first step is to click SUBSCRIBE and CLAP for this article (50 claps max if you’re feeling it πŸ˜‰ ). Because this requires a huge amount of time and commitment on my end, the speed that this tutorial series will come out depends on how much YOU the reader expresses your support πŸ™Œ I work best when people are relying on me. Share this with your friends if you think they might find it interesting.

Amazon, if you’re reading this… πŸ™ Please send some Cloud Credits my way, it would help cover the costs for hosting live demos and I’d appreciate it very much ❀️

Table of Contents

These articles are meant to be read in order as each article builds upon previous concepts taught. But you can also read them independently if you’re already familiar with AWS.

[ 2 completed, 27 pending ] Github repos coming soon.

  1. Creating Your AWS Account β€” Initial Setup with Security from Day 1
  2. $0.01 Websites with Amazon S3 β€” Hosting Websites
  3. Security from Day 1 β€” With IAM
  4. Visit Me At WWW β€” Domain Registration with Amazon Certificate Manager and Route53
  5. Literally Hello World β€” Global Content Delivery with Amazon CloudFront
  6. Admin vs Developer β€” Setting Up Account Security with Amazon IAM
  7. Passwordless Sign In β€” User Accounts with Amazon Federated Identities
  8. Is Your Name on the GuestList? β€” Secure Amazon S3 Storage with ACLs and IAM Roles
  9. A Web Security Walkthrough β€” Amazon Security Groups, Access Control Lists & Origin Checks
  10. We Don’t Talk With The Outside World β€” Setting up Amazon VPC security
  11. The Cloud Workhorse β€” Amazon EC2
  12. Infinitely Scalable Backends Pt 1 β€” Amazon Lambda
  13. Infinitely Scalable Backends Pt 2 β€” Amazon API Gateway
  14. Infinitely Scalable Backends Pt 3 β€” Serverless Framework
  15. Infinitely Scalable Backends Pt 4 β€” Amazon Cloudwatch
  16. Infinitely Scalable Backends Pt 5 β€” Scheduled Lambda Jobs
  17. Infinitely Scalable Backends Pt 6 β€” Honorable Mentions: Amazon ELB and FarGate
  18. Super Databases Pt 1β€” NoSQL with Amazon DynamoDB
  19. Super Databases Pt 2 β€” SQL with Amazon RDS
  20. Super Databases Pt 3 β€” Hosted ElasticSearch on Amazon
  21. Super Databases Pt 4 β€” Amazon S3 with Athena
  22. Super Databases Pt 5 β€” Graph Networks with Amazon Neptune and GraphQL
  23. Super Databases Pt 6 β€” Information Across Time with Amazon TimeSeries
  24. Super Databases Pt 7 β€” Getting Superfast with Amazon Elastic-Cache
  25. Super Databases Pt 8 β€” Everything In One Place with Amazon RedShift
  26. You And What Army β€” Custom Email Accounts with Amazon SES
  27. The Infrastructure Is Talking β€” Coordinating Notifications with Amazon SNS
  28. The Phone Lines Are Tapped β€” Controlling Calls and SMS with Twilio
  29. Get In Line Buddy β€” Managing Queues with Amazon SQS
  30. Catch Me If You Can β€” Scraping Web Data with Chrome Puppeteer
  31. An Intelligence Walkthrough β€” A Tour of Amazon A.I. Services
  32. How Would You Like To Pay? β€” Stripe Integration on AWS
  33. Paying Rent To Big Daddy AWS β€” Billings and Monitoring

Articles Categorized By Subject Acts:

Act 1: Website Hosting

When hosting a website, there are 3 things we want it to be:

  • Available β†’ can visitors access your website fast around the world?
  • Secure β†’ does your website have the HTTPS green bar?
  • Cheap β†’ website hosting for minimal cost

If you don’t need server-side rendering, we can very conveniently achieve all of these easily using two AWS services:

  • Amazon S3 β†’ File Storage which will act as cheap website hosting
  • Amazon CloudFront β†’ Global distribution of your website with HTTPS green bar

Accompanied by these supporting AWS services:

  • Amazon Route 53 β†’ Managing your domain routes and where they point to
  • Amazon Certificate Manager β†’ Managing your domain ownership

Act 2: User Authentication and Security

As a general rule of thumb, security should be foundationally built into your product. Most of what we need for security can be achieved with the following AWS and 3rd party services:

  • Amazon Identity Access Management (IAM) β†’ Deciding who gets access to what
  • Amazon Virtual Private Cloud (VPC) β†’ Isolating your services into private intranets to protect sensitive resources
  • Amazon Federated Identities (FedID) + Passwordless (3rd Party)β†’ Giving your users a convenient login system with its own IAM roles

We will also cover some key concepts such as:

  • IAM Roles
  • Security Groups
  • JSON Web Tokens & Origin Checks
  • Special Mention: AWS Key Management Service (KMS)

Act 3: Scalable Backends

There are tradeoffs to be made with backends. You can either take a microservices approach or a serverless approach. The benefit of microservices is that they are much easier to develop for, but require a little bit more management. The benefit of serverless is that they have very little management, easy security and automatic logging, but development can be a headache, especially with multiple team members.

This tutorial series will cover the serverless approach as it is the greater force multiplier for small teams. We will cover these AWS and 3rd party services:

  • Amazon Lambda β†’ run code on the cloud without managing servers or worrying about load balancing traffic
  • Amazon API Gateway β†’ turn your Lambda functions into a REST api
  • Serverless Framework (3rd Party) β†’ managing multiple lambda functions for sanity
  • Amazon CloudWatch β†’ automatic logging for your backends

And with special mentions about:

  • Amazon Elastic Compute Cloud (EC2) β†’ virtual servers on the cloud
  • Amazon Elastic Beanstalk (ELB) β†’ load balancing traffic to EC2
  • Amazon FarGate β†’ manage Docker containers
  • Amazon Lambda Scheduled Jobs β†’ prescheduled tasks on the cloud

Act 4: The Super Databases

This is the longest chapter of this entire series. It covers the wide variety of storage options available to you and their use cases. We will cover these AWS Services:

  • Amazon DynamoDB (DYN) β†’ scalable noSQL database for unstructured data
  • Amazon Relational Database Service (RDS) β†’ scalable SQL database for structured data, with a special focus on Amazon Aurora SQL
  • Amazon hosted ElasticSearch (ELS) β†’ an amazing noSQL database that allows for extremely flexible and precise querying on unstructured data
  • Amazon Simple Secure Storage (S3) β†’ the easiest way to store data and make it available for users

We will also have special mentions for:

  • Amazon Neptune (NEP) β†’ a hosted Graph database useful for querying on complex multi-dimensional relationships
  • Amazon Timeseries (TMS) β†’ an immutable database of events happening over time
  • Amazon ElasticCache (ELC) β†’ a hosted key-value store useful for rapid efficient retrieval of information when querying an entire database doesn’t make sense
  • Amazon RedShift (RED) β†’ a massive columnar database where you can injest all your other data for one central place for querying
  • Amazon Athena (ATH) β†’ run SQL queries on data inside your S3 buckets

Act 5: Communications F*ck Yeah

Here we will cover the various AWS and 3rd party services available for managing your communications infrastructure.

  • Amazon Simple Email Service β†’ create and manage custom emails accounts for users or your organization
  • Amazon Simple Notification Service β†’ lets your AWS services talk to each other with pub/sub messaging
  • Twilio β†’ lets you integrate phone calls and SMS text messaging into your product infrastructure
  • Amazon Simple Queue Service β†’ an easy way to queue requests or messages for batch handling

Act 6: Intelligence and Data Collection

It’s no surprise that the next big technology your organization needs to be leveraging is A.I. (Artificial Intelligence). Luckily you don’t need a team of PhDs to benefit from A.I. thanks to Amazon’s rapidly growing arsenal of intelligence-as-a-service. A.I. requires lots of data, but sometimes we don’t have it ourselves. Luckily the internet is the world’s largest store of information and we will go over how to scrape this data. This Act will cover:

  • Puppeteer β†’ control a chrome browser using code and run it on virtual servers without needing a physical screen
  • Amazon Rekognition β†’ image recognition that can be modified to your subject domain. how many people are in this image? What is the dominant color scheme?
  • Amazon Comprehend β†’ natural language processing that can be modified to your subject domain. what are users saying? how do they feel?

There has been an explosion of intelligence services from Amazon that are worth a special mention. Some are publically available while others are in private beta.

  • Amazon Polly β†’ Turn text into spoken word
  • Amazon Transcribe β†’ Turn spoken audio into text
  • Amazon Translate β†’ Translate text between languages
  • Amazon Lex β†’ Build chatbot flows
  • Amazon DeepLens β†’ identify what’s happening in videos
  • Amazon Textract β†’ turn articles and blogs into intelligent question and answer databases
  • Amazon Forecast β†’ used with Amazon Timeseries database. predict what will happen next based on past events
  • Amazon Personalize β†’ generates recommendations to your users based on what they’ve already liked

So It Begins…

Have I missed anything? Tell me in the comments below! 😊 If you haven’t yet already, subscribe and leave some claps! I look forward to learning together with you in 2019.

Kangze Huang

Written by

Finance, Code and Entrepreneurship. Founder of RentHero AI

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium β€” and support writers while you’re at it. Just $5/month. Upgrade