Advanced automation tools – The Tools to Take Your DevOps to the Next Level
Advanced automation tools
Throughout this book, I have emphasized the value of automation and how important it is to the DevOps realm and the increase of your productivity in general. It is very hard to go overboard with automation as long as you’re careful with it and understand your use case. We have expanded our toolbelts throughout this book to allow us to automate tasks in a number of scenarios. We even figured out how to automate those automations. But now, let’s look into a tool that may take this process a step further. It also happens to be a personal favorite of mine.
AWS Step Functions is something that I am always excited to talk about and use. Whenever I look for the gold standard of automation workflow tools, it is this that I think of. Any other automation tool that I have seen that works well has had very similar functionality and usability to Step Functions. There are, of course, equivalent services in the other major clouds that can be used as a replacement and that work well in those environments, but the UX on Step Functions is the one that I prefer and is the one that will be the easiest to explain in this workflow.
Let’s go into a few steps (and steps inside of steps) in Step Functions:
- Log in to your AWS account, and on the console, search for Step Functions.
- Go to the Step Functions page, and at the top right, click on Create state machine.

Figure 13.1 – Creating a state machine
The Step Functions workflow consists of actions, which are the invocation of services, completely based on the parameters that their APIs take, and flows, which direct the flow of the data.
The example function that we will demonstrate consists entirely of flows since using actions simply requires calling APIs, and you can apply them wherever you see fit. Here is a diagram of this flow:

Figure 13.2 – State machine diagram
This was exported directly from the Step Functions console, which you can see here:

Figure 13.3 – State machine console
It has also been exported in code format and placed in the GitHub repository of this book for use.
We can break down the diagram in Figure 13.2 like this:
- The parallel state runs two different functions, Ping and Pong.
- Both of them produce random numbers between a start and end value that the user inputs.
- Once this is done, both numbers are compared to see which one is greater than the other.
- If Ping is greater than Pong, the state machine stops its execution; otherwise, it executes the parallel state instead.
3.Once you have saved your state machine, you can access it and run it using the Start execution button.

Figure 13.4 – Starting an execution on a state machine
4. You will be asked what you would want to input in this state machine. In this case, we will choose the starting number as 5 and the ending number as 100.

Figure 13.5 – Parameters given to start the state machine
- The machine will go until Ping and Pong give us equal values, which takes about two seconds for numbers as small as this.
- Step Functions logs all of the states that it passes, along with the results:

Figure 13.6 – Events that occurred during the state machine
This particular application seems rather mundane, but it is a great proof of concept for how Step Functions can be used to make workflows. An example of a real-world application for this could be a simple one that we have used before: deleting all the objects in an S3 bucket. There is no clear way in the user interface of AWS to delete all your objects at once; you need to do it one by one. But with Step Functions (which is integrated with every AWS service), you can list out and delete all the objects in an S3 bucket in parallel if you want to. Now, we will pivot to the monitoring of such applications to learn some insights into how to make them even better.