Deploy StackStorm to AWS Using a GitHub Action

Deploy StackStorm to AWS Using a GitHub Action

This blog will explore how you can use Github Actions to deploy Stackstorm to AWS in just a few clicks!

Check out this blog’s companion video, which visually walks through everything here!

A Quick Summary of Stackstorm

StackStorm is an open-source, event-driven automation platform that helps organizations automate tasks, processes, and workflows. You can use StackStorm to automate a wide range of IT operations, including infrastructure management, incident response, and application deployment.

StackStorm uses a rules engine to define automated actions in response to various events, which can be triggered by external sources such as monitoring tools or user input. It also includes a powerful API and a command-line interface (CLI) for interacting with the system and extending its functionality. StackStorm is designed to be highly modular and extensible, allowing organizations to customize and tailor it to their specific needs.

To deploy StackStorm to your AWS account with GitHub Actions, you’ll need three things:

A GitHub repo + user permissions to modify settings and trigger GitHub actions

There are only a few steps you need to take to be up and running with StackStorm!

Create a repo to run actions from
Add ST2_AUTH_USERNAME
Create a workflow for the ST2 installation

Yes, that’s it!

1. Github Repository

To begin, create a new repo to house your deployment workflow. Using your preferred browser, navigate to Github.com. Sign in, then on the top right of the window, click on the add dropdown > New Repository.

Bitovi suggests that you name the repo: Operations-Stackstorm however, nothing restricts you from doing otherwise.

Finally, clone your new repository locally.

2. Github Repository Secrets

Staying in the browser, navigate to the newly created repository page > Settings > Secrets > Actions.

On the top right of the page, click on the green green button Create Repository Secret

Create a Secret with the corresponding name and value for each of the values below.

AWS credentials will be used to create new resources, such as the EC2 instance and security groups.

ST2_AUTH username and password will be used to create a new user identity in the stackstorm instance. Use the ST2_AUTH username and password to log into the Stackstorm console.

3. Create Workflow

Using your preferred code editor, open the repository.

Create the following two folders in the project root; .github/workflows/

Create a new file called .github/workflows/deploy-st2.yaml with the contents;

This file uses the bitovi/github-actions-deploy-stackstorm action, which contains the IaC for provisioning the resources for and deploying Stackstorm to an AWS EC2 instance.

Make changes if you deem them necessary. Save the file and prep the commit to push your newly created folders and files to GitHub.

4. Trigger Workflow

And finally, the last step… and it’s the easiest one! With your commit loaded and ready to be pushed, let’s take a quick look back at our action to understand what the trigger will be;

We can see that the trigger for this action is: Trigger On a Push to the Main Branch

So let’s push our code to trigger our workflow to create infrastructure for and deploy Stackstorm to an EC2 instance!

5. Monitor Action

6. Confirm the deployment

Back in your browser page, navigate to the above-created repository’s main page. On the top repository nav bar, select > Actions > Deploy ST2 Single VM with GHA

If the instructions above have been followed, you should either see a yellow yellow indicator light for in-progress or a green green indicator light for success

Under the Hood

Platform Engineering using GitHub Actions

GitHub Actions are evolving from simple CI runners into a platform engineering service for developers that provides a powerful and flexible way to automate software development workflows.

BitOps is used to orchestrate the deployment sequence for the tools used to provision and deploy to infrastructure. BitOps can be best summarized as a prepared Docker environment for invoking DevOps provisioning and deployment tools. BitOps is highly customizable and completely Open Source! Head over to the BitOps documentation or our GitHub Page to learn more.

Webinar: Github Action to Deploy StackStorm

There’s more we want to show and tell. Join us for a free live webinar on April 4, 2023, at 11 am US Central time, where we’ll talk about the power of Platform Engineering, GitHub Actions, and StackStorm event-driven automation.

Need Help?

Need DevOps Consulting services? Bitovi has consultants that can assist with all aspects of your development and DevOps journey.

Written by chat.openai.com. Prompted and edited by Bitovi.

This content was originally published here.