If you want to get into microservices, but aren’t ready to take the container plunge, you can deploy mu projects directly to AWS EC2 instances. Using mu’s EC2 mode, you can leverage the benefits of microservices without containerization, and speed up development feedback loops.
The web app in this article is the smallest possible Flask application. You can adapt this example to deploy other applications that include their own web servers, like Django, NodeJS with Express, Ruby with puma/thin/passenger, Jetty or even Spring Boot.Stelligent mu is a great open source tool to deploy Microservices to the AWS cloud. It has three modes of deployment:

Walkthrough of the mu pipeline

The mu pipeline up command creates the CloudFormation stacks for the CodePipeline, CodeBuild and CodeDeploy services.
Navigate to the CloudFormation console, and watch the pipeline stacks form. They’ll look something like this:
Once the pipeline stacks are created, open the CodePipeline console. You should have one pipeline listed. Click on it.
The mu pipeline looks like this:

Source – the CodeBuild service retrieves a copy of your source code from GitHub or AWS CodeCommit.

Acceptance – a new environment called “acceptance” is created (or updated) with your software. This uses AWS CodeDeploy.

Production – after the one-and-only manual step, which is to offer Red and Green buttons to stop the pipeline, or deploy the software that is in Acceptance to the last environment, which is Production. This also uses AWS CodeDeploy.

Once the pipeline stacks are complete, you can watch the CodePipeline execute. The CodePipeline/CodeDeploy/CodeBuild services start building your software within a few moments.
When your pipeline reaches the Deploy stage, the CodeDeploy service creates Infrastructure stacks for each Environment, and will update them with each subsequent build. This is another core concept in DevOps known as infrastructure-as-code, and is fully implemented by mu pipeline.
The additional environment stacks look like this:
The infrastructure created by these additional stacks include:

networking: VPC, subnets, security groups

compute: EC2 instances (alternatively, ECS and Fargate are also supported in mu)

This means that if you want to change your infrastructure (AutoScaling parameters, your EC2 or RDS instance sizes, etc), you can implement those changes the same way you do your code changes: Change a file, run git add, git commit, and git push!

Naturally, this example of mu usage starts with a mu.yml. There are two sections: one for environments, and one for services.
The environments: section from lines 2 to 6 (above), are a simple list of the environment names you wish to have (acceptance, staging, sandbox, demo, production, whatever). The provider value can have one of three different values (ec2, ecs, and fargate).
To learn more about other configuring mu environments, refer to the wiki page for Mu Environments.
The services: section is from lines 8 to 17 (above), and specifies just the bare necessities. We’re going to accept incoming connections on port 80, route them to our application on port 8080, checking the / endpoint for 200 OK responses, and use the code in the repo specified on line 17.
To learn more about configuring mu services, refer to the wiki page for Mu Services

buildspec.yml

mu uses AWS CodePipeline, CodeBuild, and CodeDeploy to turn your github repo into a deployed service. The buildspec.yml contains instructions (lines 3-6), on how to install prerequisites, how to invoke the build, do any postprocessing (minification, compression, archiving, etc).
å
Finally, you specify what files are to be deployed via the artifacts/files: section from line 8 to 10.
You can (and should) also use buildspec.yml to run unit tests. Make sure all your commands return non-zero if there are any failures.

hello.py

In this example repo, we have included the smallest possible Flask application possible, predictably named hello.py. It listens on a port number, and responds to incoming GET / requests with a hardcoded string.
So, now we just needs to tell the system how to install it, start it, and stop this service.

The appspec.yml file contains the commands that install, start and stop the service.

The files section tells the system which files to move, and where they should reside.

There are hooks section, with hooks called BeforeInstall (line 8), ApplicationStop (line 11), and ApplicationStart(line 14). Each hook has a script location and a timeout in seconds. These scripts reside in a codedeploy directory, primarily to keep the root directory a little cleaner.

Use your new application

Use mu env show acceptance to display key information about your app. One of the attributes is the ELB endpoint.

Conclusion

This repository demonstrates using mu to deploy software to EC2. You should also know that this is just one of several deployment models that mu supports. mu can also dockerize your application and deploy it to AWS Elastic Container Service (Amazon ECS) and AWS Fargate. For the latest developments in mu, you can watch the mu repository.
Now that you got your microservice running on EC2, you should know that EC2 can be more expensive than ECS/Fargate in the long run. To take advantage of ECS and Fargate, you will have to learn a bit about creating a basic Dockerfile. There are other mu-related pages about deploying Microservices to AWS ECS and AWS Fargate.
Stelligent engineers also staff a live chat/support forum at gitter.im/stelligent/mu. You can also read through the mu wiki or file an issue.