Automation: Computers Never have a Bad Night’s Sleep

Chris Buckley

Automation: Computers Never have a Bad Night’s Sleep

In 2019, it seems impossible to go a day without seeing the word ‘automation’ – broadly speaking, defined as the delegation of repetitive labour to machines. While it means different things depending on who you speak to, it has a very specific (and a very positive) meaning in the IT industry – particularly as it relates to cloud.

One of the least known secrets of the IT industry (to outsiders) is the sheer quantity of repetitive, manual work your average technology worker spends their day doing just to metaphorically keep the lights on. For as long as sysadmins (and systems engineers, developers, or DevOps engineers) have been around, they’ve been using any means available to offload these manual tasks to computers – freeing them up to work on interesting projects, innovate, and add value back to the business. A side benefit of this is that these boring tasks are completed correctly and on time every single time. Computers never have a bad night’s sleep and never take sick days!

AWS offers us countless ways to leverage automation to make our lives easier. Platforms run more smoothly, and cloud teams can do higher-value work that requires innovative thinking only a human brain can do.

How can AWS be automated in the best ways, at any stage of the cloud journey?

It’s important to look at how to implement automation as your cloud environment grows – ensuring your team stays focused on delivering business value, and not burning hours on low-value tasks that don’t inspire them.

Day 1: Automating Your First Steps

Before your team deploys their first resources in AWS, they should already be leveraging automation. Automating the deployment and management of your infrastructure ensures your team can a) rapidly redeploy that infrastructure whenever they want, and b), know it’ll be the same infrastructure every single time.

This has the added benefit of saving the trouble of provisioning all of the resources in the right order, including checking (and re-checking) that all the configuration details are correct.

Infrastructure as Code (IaC) is the answer here. IaC lets your engineers define their infrastructure in configuration files called templates. You can customise your templates with variables to make them portable, so you can easily redeploy your infrastructure in a new region or a temporary sandbox for testing a new version of your application.

Each IaC language also has its own deployment engine that ingests your IaC templates and automatically deploys the infrastructure you’ve defined in the right order. There are two primary IaC options for AWS: the AWS-native CloudFormation, and the cloud-agnostic Terraform. Both have their benefits in certain scenarios (Rackspace uses both, depending on what we’re deploying), so do your research, find the right language for you, and deploy away!

The other Day 1 task that you can automate right away is the installation, configuration, and patching of operating systems, utilities, middleware (and even your full application stack) across your AWS fleet. AWS Systems Manager allows you to do all of this (and an awful lot more) using patch sets to patch your EC2 instances’ operating systems, and SSM Documents to execute tasks on your EC2 instances.

There’s a wide range of pre-made SSM documents available, you can write your own and many can be customised – such as the documents that let you execute Bash, Python or Powershell scripts across your fleet. Rackspace customers also get access to a huge range of SSM Documents that Rackspace’s FAWS Support Engineers have written to automate common tasks that we see across our massive customer base.

All that’s needed to get started with SSM is to ensure the AWS SSM agent is installed on your EC2 instances, and you’ve got the right IAM roles configured. Rackspace can help get this up and running, and every environment we deploy is ready to use the full power of SSM.

Day 2: What Next?

So you’ve now reached the metaphorical ‘Day 2’ of your cloud journey. Your infrastructure’s been deployed using IaC and your EC2 fleet is being administered almost entirely automatically with SSM. You’ve got engineers with time to spare – so what do they do now?

The answer to this question is different for every business. In my experience, the answer is usually to identify the next thing they can automate, and then once that’s done, automate the next thing! Repeat until there’s nothing left to automate (although I’ve never seen this happen).

Many businesses choose to introduce continuous integration and continuous delivery (CI/CD) pipelines to build, test and deploy their applications to their AWS environment. This is a highly valuable undertaking that drives collaboration between teams and puts many businesses on the path to adopting a DevOps culture.

Something to consider when you’re looking at building your application CI/CD pipelines is moving to more advanced IaC deployment methods that leverage software development practices. These include the use of pipelines such as test-driven development, automated template linting, smoke tests, regression tests, and post-deployment integration tests. These will drive down error rates and speed up deployment times for your platform’s infrastructure and your applications.

For those starting out on a cloud journey, this process can seem intimidating. But it’s amazing how easy AWS makes it to get there given the power of its APIs and native services. Once you encourage offloading the manual drudge to machines and challenge your engineers to see what they can solve next, your business will perform better than ever before, thanks to the power of AWS’s cloud.

Not sure where to start? Get in touch with Rackspace – we’d love to help you develop your business’ automation strategy.