Creating roles to deploy and start our web application

We are going to use roles to recreate the Hello World stack we made previously using the UserData block of CloudFormation. If you recall, the UserData section 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 a Node.js package. Next, we copy the different resources needed to run the application. In our case, this is the JavaScript code and the upstart configuration. ...

Get Effective DevOps with AWS - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.