Book Image

Implementing DevOps on AWS

By : Vaselin Kantsev
Book Image

Implementing DevOps on AWS

By: Vaselin Kantsev

Overview of this book

Knowing how to adopt DevOps in your organization is becoming an increasingly important skill for developers, whether you work for a start-up, an SMB, or an enterprise. This book will help you to drastically reduce the amount of time spent on development and increase the reliability of your software deployments on AWS using popular DevOps methods of automation. To start, you will get familiar with the concept of IaC and will learn to design, deploy, and maintain AWS infrastructure. Further on, you’ll see how to design and deploy a Continuous Integration platform on AWS using either open source or AWS provided tools/services. Following on from the delivery part of the process, you will learn how to deploy a newly created, tested, and verified artefact to the AWS infrastructure without manual intervention. You will then find out what to consider in order to make the implementation of Configuration Management easier and more effective. Toward the end of the book, you will learn some tricks and tips to optimize and secure your AWS environment. By the end of the book, you will have mastered the art of implementing DevOps practices onto AWS.
Table of Contents (17 chapters)
Implementing DevOps on AWS
About the Author
About the Reviewer
Customer Feedback
Free Chapter
What is DevOps and Should You Care?
Build, Test, and Release Faster with Continuous Integration


DevOps and AWS are two key subjects in the tech industry that have been steadily growing in popularity in recent years and for a good reason.

DevOps is gradually becoming the de facto methodology or framework and is adopted by organizations of all sizes. It has enabled technology teams to work more efficiently and made their work more rewarding by tightening the feedback loop between the developer and the end user. Team members enjoy a more pleasant, more productive work environment through much increased collaboration.

In this book, we will first examine the philosophy behind DevOps, then proceed with some practical examples of its most popular principles.

AWS is nowadays synonymous with Cloud Computing, sitting at the top of the industry charts with its 31% market share. Starting back in 2006, Amazon Web Services has evolved into a large, independent, sophisticated ecosystem in the Cloud. It is and has been launching new services at an astonishing rate. The AWS product categories range from raw compute and database resources to storage, analytics, AI, game development, and mobile services to IoT solutions.

We will use AWS as a platform to apply DevOps techniques on. In the chapters to follow, we will see how the convenience and elasticity of AWS greatly complements the innovative approach of DevOps to system administration and application development.

What this book covers

Chapter 1, What Is DevOps and Should You Care?, introduces the DevOps philosophy.

Chapter 2, Start Treating Your Infrastructure as Code, offers examples on how to deploy infrastructure as code using Terraform or CloudFormation.

Chapter 3, Bring Your Infrastructure under Configuration Management, demonstrates how to configure EC2 instances using SaltStack.

Chapter 4, Build, Test, and Release Faster with Continuous Integration, describes the process of setting up a CI workflow using a Jenkins CI server.

Chapter 5, Ever-Ready to Deploy Using Continuous Delivery, shows how to extend a CI pipeline to produce deployment-ready EC2 AMIs using Packer and Serverspec.

Chapter 6, Continuous Deployment - A Fully Automated Workflow, Offers a fully automated workflow and completes the CI/CDelivery pipeline by adding the functionality needed for AMI deployment.

Chapter 7, Metrics, Log Collection, and Monitoring, introduces Prometheus,  Logstash, Elasticsearch,and related DevOps tools.

Chapter 8, Optimize for Scale and Cost, offers advice on how to plan an AWS deployment with scalability and cost efficiency in mind.

Chapter 9, Secure Your AWS Environment, covers best practices in order to improve the security of an AWS deployment.

Chapter 10, AWS Tips and Tricks, contains a selection of useful tips for a beginner to an intermediate AWS users.

What you need for this book

The practical examples found in this book involve the use of AWS resources, thus an AWS account will be required.

The client-side tools used in the examples, such as the AWS CLI and Terraform, are supported on most common operating systems (Linux/Windows/Mac OS).

Who this book is for

This book is for system administrators and developers who manage AWS infrastructure and environments and are planning to implement DevOps in their organizations. Those aiming for the AWS Certified DevOps Engineer certification will also find this book useful. Prior experience of operating and managing AWS environments is expected.


In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We need to SSH into the node and retrieve the admin password stored in /var/lib/jenkins/secrets/initialAdminPassword."

A block of code is set as follows:

aws-region = "us-east-1" 
vpc-cidr = "" 
vpc-name = "Terraform" 
aws-availability-zones = "us-east-1b,us-east-1c" 

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

aws-region = "us-east-1" 
vpc-cidr = "" 
vpc-name = "Terraform" 
aws-availability-zones = "us-east-1b,us-east-1c" 

Any command-line input or output is written as follows:

$ terraform validate
$ terraform plan
Refreshing Terraform state prior to plan...
Plan: 11 to add, 0 to change, 0 to destroy.
$ terraform apply
aws_iam_role.jenkins: Creating...
Apply complete! Resources: 11 added, 0 changed, 0 destroyed.
JENKINS EIP = x.x.x.x
VPC ID = vpc-xxxxxx

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "We select Pipeline as a job type and pick a name for it."


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

The complete set of code can also be downloaded from the following GitHub repository:

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to and enter the name of the book in the search field. The required information will appear under the Errata section.


Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.


If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.