• 10 hours
  • Medium

Free online content available in this course.

course.header.alt.is_video

course.header.alt.is_certifying

Got it!

Last updated on 2/27/23

Discover Automation, a New Approach to Your Infrastructure

As time goes on, you’ll hear more and more about automation in your professional life. You know that it’s a key factor for the efficiency of operations in the cloud, but why has it suddenly become so widely used? In this chapter, you’ll find out how automation will change your approach to systems.

Understand How Automation Can Help You

Over the past few years, automation has become part of our daily lives and is no longer just something used on production lines. For example, you can now ask Alexa to make you a coffee, and your lights can switch on in your house when your phone connects to the Wi-Fi as you come in. But we’re dealing with another type of automation here—one of IT infrastructure. It’s not a million miles away from automating everyday objects, but the objectives are different.

Anyone coming from the development world is used to writing scripts for almost everything. However, this isn’t everyone’s first reflex:

  • “The code? This is where you compile it, and then you can send it in a ZIP file by email to Michael in production.”

  • “Oh, you’re the new guy! I don’t have time to give you access today—it’s a long process. We’ll need to create an account for you in all the applications.”

  • “I do this part by hand—it’s quicker.”

  • “I always go through the migration script line by line to check it.”

Luckily, most development teams use automated systems for all the tasks they deal with, such as checking code created by developers, testing, etc. If you ask these teams about the benefits of automating their processes, they might tell you that:

  • It means that the team no longer has to deal with repetitive tasks.

  • It ensures that processes can be replicated.

  • It speeds up daily tasks.

  • It makes it easier to orchestrate complex tasks.

In the world of infrastructure, many teams now also use automation tools such as Chef or Puppet. Automation provides similar benefits for system administrators as it does for developers:

  • It allows them to manage hundreds of computers and servers effortlessly.

  • It ensures all computers and servers are properly configured.

  • It enables rapid installation of a new computer.

  • It helps orchestrate updates.

Previously, there was just one remaining area where automation was impossible—creating new servers, which required someone to be physically present to deploy them manually. However, the cloud and on-demand services have now removed this barrier.

In fact, the cloud is purposely designed for automation. All components can now be controlled via APIs.

Infrastructure as Code, From Ops to DevOps Ninja

In AWS documentation, you’ll sometimes come across the term infrastructure as code (IaC)

What does that mean?

Infrastructure as code refers to the practice of describing the infrastructure of your systems using code.

But what does that change for me?

It means that as well as automating configuration tasks, you can also automate the creation and maintenance of your infrastructure. For example, imagine you need to create around 100 machines—all you need to do is to write a script like this:

for x in 1 to 100:
   create-machine x 

Once you apply this script correctly, the cloud then creates these 100 virtual machines for you. Simple!

On-Demand Infrastructure, a Maintenance Tool

Now you’ve had a brief introduction to the concept of infrastructure as code, let’s take a look at what on-demand infrastructure allows you to do in practice.

Imagine you’re working for a TV channel, and you know that every year when the president makes his State of the Union address, the number of connections to your website shoots up, as many people watch it online from their smartphone.

You need to meet this demand; otherwise, people will go to a rival channel to watch the speech.

The problem is that you have to stay late at work every year to add the servers. This year, though, you’ve decided you won’t be working a minute of overtime, as you’ve scheduled a piece of code to run, which automatically adds servers in the cloud.

What’s more, it also helps you manage versions. Let’s take a more detailed look at this. 

Version Management in Your Infrastructure

Let’s take another practical example:

One morning, panic breaks out at the office. Josie from accounts is trying to pay everyone’s wages, but their server is down.

You haven’t changed anything, but Jonathan from the night maintenance team has left a sticky note on your desk telling you that he’s migrated to a new domain.

It turns out that the migration didn’t work, and Jonathan forgot to check it. This complex migration requires hours of work, so you need to find a quick solution to go back to how things were before the migration and help Josie get back to work as soon as possible.

Luckily, you work using infrastructure as code, and you’ve been using a version control system such as Git to manage it. You delete Jonathan’s migration in the infrastructure description files, and restore the previous version in the blink of an eye. Fifteen minutes later, the job’s done, and Josie brings you some of her famous homemade cookies, which she keeps in a drawer by her desk as a thank you. Enjoy them; you’ve earned it!

To find out more, check out this course: Manage Your Code Project With Git and GitHub.

Finally, let’s look at a third way you can use code to manage your infrastructure: documentation.

Use Code as Documentation in Your Processes

Here’s one last scenario before we come to the end of this part of the course:

Imagine you’re starting an internship on an IT team to replace another intern. The start date is badly timed—you arrive on Monday, and the last intern left the previous Friday, so they aren’t there to show you the ropes.

In this internship, your role is to maintain a PHP website on a virtual machine in the cloud.

Unfortunately, when you arrive on Monday, the website isn’t working, and your supervisor is out sick, having had one too many at your predecessor’s going away party.

You hunt for clues on the previous intern’s desk and unearth a crumpled sticky note bearing the words “for deployment: git pull && make install.

You connect to the company’s source code manager and find the intern’s repository, then download the code and look in the makefile. You quickly realize that the application is compiled and then sent to an archive server, where the website gets its updates. When you look closely at the archive server, you notice that the file it contains is corrupted, which means the website has been updated with a version that doesn’t work. 

You launch a make install to fix this, and the website is reinstalled and starts working again.

In this example, automation of the website deployment mechanism set up by the previous intern allows you to deploy the website without needing any in-depth knowledge of how it works and to investigate and identify a problem starting from scratch—all you have to do is follow the pathway created by the automation system.

A software component alone would be very unlikely to have sufficient documentation to do this, and even if it did, it may not be up to date or might be incredibly complex.

Conclusion: automation allows you to focus on what creates value.

The value of your product—what keeps your company running—is the content or resource you provide for your users. Automation takes care of repetitive tasks for you, so you can focus on the most important aspect: producing code or infrastructure to provide a service for your clients.

Let’s Recap!

  • Automation:

    • Handles repetitive tasks for you.

    • Ensures that processes can be replicated.

    • Makes things quicker.

    • Helps you orchestrate complex tasks.

    • Documents production processes.

  • Infrastructure as code:

    • Simplifies system maintenance.

    • Enables versioning of your infrastructure.

Now let’s go to the third chapter of this first part to learn about the advantages of deploying your systems and networks in the cloud before moving on to the key part of the course—installation!

Example of certificate of achievement
Example of certificate of achievement