In Chapter 2, Deploying Your First Web Application, we familiarized ourselves with AWS. We also created an EC2 instance and deployed a Hello World web application onto it but to get there, we had to go through a number of steps to configure the instance and its security groups. Because we did that in a very manual fashion using the command-line interface, those steps we went through will not be reusable or auditable, as you may recall from the first chapter when implementing DevOps best practices. Two key concepts are that you should source control everything and should rely on automation as often as possible. In this chapter, we will see how to apply those principles to our infrastructure.
In a cloud environment where almost everything is abstracted and served through the intermediary of virtual resources, it is easy to imagine that code can...