Harsh Mighlani
5 min readAug 27, 2020

Deploying in a few clicks- Easy wins on AWS

In this post, I would be listing down a few ways for deploying small to medium application on AWS just with a few clicks. With AWS, you can deploy an application in many ways depending upon technology in which code is written, application usage, traffic estimate, turnaround time, global reach etc:

Dumb Sites (Static Pages)

I recently used AWS Amplify and the entire build, deploy, host cycle took less than 10 minutes. AWS Amplify provides out of the box feature all under single UI and makes life really except for code of course. Below are the highlights making it a distinct winner in hosting websites:

  • You can bind it to Github, Bitbucket and GitLab account seamlessly
  • Ability to maintain versions- You get to deploy any version of your application with just one click
  • Multi environment support- you can run multiple versions of your application across environment tied to different branches
  • Restrict access control with basic auth
  • Just like any modern browser, it provides you screenshots of how application would render across various devices.
  • Support with other AWS services- You can bind your application with SSL certificate, add a host name, integrate with Route 53 and have notifications sent to your email via SNS.

You can provide the sequence of steps to be performed in a YAML file and in 4 simple steps your application is ready.

https://docs.aws.amazon.com/amplify/latest/userguide/getting-started.html

It provides the support of PWA apps like Ionic and can deploy any stack starting from static HTML to full fledged web app. With direct control to your repo, maintaining code revisions is really easy.

Classic WAY:

Previously, to host a blog or static website, below components were first choice with below steps:

  • Register a domain name of your choice( Route 53).
  • Create an S3 bucket (& upload the html files).
  • Enable static website hosting in bucket properties.
  • Provide public access in bucket policy.
  • Create a cloud-front distribution & link origin with the URL created above.
https://aws.amazon.com/getting-started/hands-on/host-static-website/

SMSA(Small & Medium Size Apps:

Next up is AWS Lightsail which again is huge win over classic EC2, below are deployables for LightSail:

  • NodeJS Api’s
  • Stack like LAMP, Nginx, MEAN,Drupal
  • Classic websites like Wordpress, Joomla etc

For those who know spring framework, this seems analogous to Spring boot v/s Spring, just have your starter dependency and get going, no need to manage versions on your own. And since first month is free, this is worth playing with..

A Lightsail instance is a virtual private server (VPS) that lives in the AWS Cloud.(A virtual private server (VPS) is a software representation of a physical server you can use to allocate compute resources for a job while remaining abstracted from the physical server layer)

As per AWS documentation:

You can get preconfigured virtual private server plans that include everything to easily deploy and manage your application. Lightsail is best suited to projects that require a few virtual private servers and users who prefer a simple management interface. Common use cases for Lightsail include running websites, web applications, blogs, e-commerce sites, simple software, and more.

https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tutorial-launching-and-configuring-lamp

Classic WAY:

This one would involve having EC2 spinned up with user script having all necessary softwares, boot up the server , upload the code on S3 (or copy into the box) and get going.

Overheads were converting pem files, changing permissions to 400 etc..

Beanstalk — eb init -> eb create -> eb deploy

Next up is Managed Server where you can push your entire running application straight up to Elastic Bean stalk and let AWS handle the rest.

AWS Elastic Beanstalk has two types of environment tiers to support different types of web applications. Web servers are standard applications that listen for and then process HTTP requests, typically over port 80. Workers are specialized applications that have a background processing task that listens for messages on an Amazon SQS queue. Worker applications post those messages to your application by using HTTP.

While lightsail is good for prototype and first time users, EC2 offers more scalable and on demand power that seems more appropriate for large systems or general computing tasks(Beanstalk is powered by EC2 only behind the scenes) and for much greater control of the instance itself.

When you create an environment, Elastic Beanstalk creates a CloudFormation stack behind the scenes and this stack is visible on the CloudFormation console. Similarly, when you update an environment configuration or make a deployment it creates additional temporary stacks and/or updates the curent stack accordingly. Deployment modes with Beanstalk are All at once, Immutable, Rolling, Rolling with additional batch, Canary which is a great benefit.

Pros:

  • Supports PHP, Java, Python, Ruby, Node.js, and Go
  • Support for Docker
  • Autoscaling
  • Matches CPU config with EC2
  • Effortless rollbacks to previous versions
  • Cloudwatch Integration
  • Health monitoring with service and system level metrices
  • The ability to run your apps in multiple Availability Zones, thereby easily improving reliability.

Cons:

All being said, BIGGEST disadvantages of beanstalk is cost in comparison to serverless which is again very powerful offering from AWS, also in terms of troubleshooting Beanstalk takes its own effort but it is all being worked upon by AWS with upgrades coming up frequently.

All being said, major cost you incur in cloud involves for only two reasons:

  • I created something that i didn’t monitor or forgot completely(and got surprise at end of month),
  • I let AWS do too much of my work and so costs were higher.

Serverless:

Definition- Serverless is the native architecture of the cloud that enables you to shift more of your operational responsibilities to AWS, increasing your agility and innovation. Serverless allows you to build and run applications and services without thinking about servers.

The entire suite of offerings from AWS where no infrastructure is involved for ex — Lambda, API Gateway, DynamoDB, S3, Kinesis,SQS,SNS qualify as serverless since it eliminates infrastructure management tasks such as server or cluster provisioning, patching, operating system maintenance, and capacity provisioning.

Closure:

For every use case, there are multiple possibilities to achieve the goal and responsibility to carefully choose the option becomes even more important, I would discuss the parameters to be considered soon, meanwhile below are the summarized options we have to deploy the use cases right now..

Harsh Mighlani
Harsh Mighlani

Written by Harsh Mighlani

AWS certified solutions architect | 12+ Years experienced | Loves Serverless & Containerization use cases.

No responses yet