Deploy on AWS using CloudFormation

The objective: automatically deploy Spacy on EC2 while creating a VPC, some SubNets, LoadBalancers and so on.  

Why would you do this if you can do it using server less technology? One word: performance.

Here’s a diagram representing the architecture we’ll instantiate:

And using LaunchConfigurations and CloudFormation we build this in a matter of minutes.

The LaunchConfiguration first performs software updates using yum. It then downloads a jar file containing a Jetty server class that gets launched and listens to http requests.  They then get proxied by the API Gateway.

You have to make your own proxying Java class, but other than feel free to get inspiration from the rest of the template, here: