GitHub Action to deploy StackStorm to AWS

Mar 14, 2023

Guest post by Bitovi, a StackStorm partner.

StackStorm is a powerful automation engine, but has a lot of moving pieces, configuration details, corner cases, and a steep learning curve. Many compare st2 with K8s and, indeed, you can spend weeks stitching things together to make the StackStorm installation and configuration pipeline fit your specific needs. Then you start benefiting from automation!

At Bitovi we work a lot with CI/CD, GitHub Actions and we created an action that helps deploying StackStorm to AWS in under 15 minutes, including all the configuration. It’s a time-saving shortcut to get your deployment ready in the cloud.

Today, we want to share it with the StackStorm community. Check the GHA on GitHub Marketplace: GitHub Action to deploy StackStorm ot AWS on GitHub Marketplace


Simple Configuration

To get started quickly, you will need to create a new github repository, set your AWS credentials in the GitHub repository secrets, and configure .github/workflows/st2.yaml:

Under the hood, it uses Terraform to provision the resources in AWS and Ansible to install and configure StackStorm. The following resources are created in AWS via Terraform: EC2 instance, Route53 records, a load balancer, security groups (ports 80, 443, 22), and optionally, a VPC with subnets. To make the Terraform configuration state persistent across the deployments, S3 bucket is created automatically. You can fine-tune the AWS configuration in GitHub Actions inputs, see AWS Configuration.


Advanced Configuration

The Ansible part relies on the official ansible-st2 roles, which allows more extensibility in cases when advanced stackstorm configuration is needed, such as adjusting the st2.conf parameters, chatops, RBAC and LDAP, users, certificates, and more. Here is an example GitHub workflow: .github/workflows/st2.yaml: An example st2_vars.yaml you include in the repository with extra StackStorm configuration for ansible-st2: We encourage you to try the StackStorm GitHub Action and feel free to open an Issue or Feature Request - we’d love your feedback at github.com/bitovi/github-actions-deploy-stackstorm!


One level deeper

We need to go deeper meme There’s one more configuration level where you can configure the deployment part. Diving one level deeper for the curious, the action was built on top of bitops.sh, a self-grown open-source framework that applies some shortcuts that Bitovi learned creating new projects for the clients. It’s like a bootstrap for infrastructure. Under the hood, we have a kitchen sink Docker image with AWS/Terraform/Ansible (replace with your stack), a predefined repository structure, as well as rules and automations to make the deployments and managing many environments a breeze. In short, you have your DevOps tools ready as well as rules and magic that saved a lot of time for us and our users to bootstrap a new project encouraging the best practices around 12-factor app, infrastructure as code, and CI/CD.


Live Webinar

GitHub Action to deploy StackStorm Webinar by Bitovi

At Bitovi, we like everything infrastructure-as-code and see value in the whole new approach of platform engineering. We aim to make something complicated like StackStorm deployments easier, enabling us to apply these practices across multiple repositories, deployments, and clients. This reduces configuration and maintenance time, as well as operational overhead, ultimately getting projects up and running more quickly.

There’s more to show and tell. We’d like to invite everyone to join us live in a Webinar where we'll highlight the power of Platform Engineering, GitHub Actions, and StackStorm event-driven automation. Join us on April 4, 2023, 11am US Central / 9am US West / 6pm EU Central time.