Creating roles to deploy and start our web application

We are going to use roles to recreate the HelloWorld stack we previously made using the UserData block of CloudFormation. If you recall, the UserData looked roughly like this:

yum install --enablerepo=epel -y nodejs 
wget -O /home/ec2-user/helloworld.js 
wget -O /etc/init/helloworld.conf 
start helloworld 

You will notice three different types of operation in the preceding script. We are first preparing the system to run our application. To do that, in our example, we are simply installing Node.js. Next, we copy the different resources needed to run the application, in our case, the JavaScript code and the Upstart configuration. Finally, we start ...

Get Effective DevOps with AWS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.