Skip to main content

Installation

Instructions for installing StackQL on various different platforms are provided here.

macOS

StackQL is available on macOS via Homebrew and the pkg Installer, both ARM (M1/Apple Silicon) and AMD architectures are supported with a single multi-arch installer.

Homebrew

To install via Homebrew, run the following command in your terminal:

brew install stackql

Package download

StackQL is available as a signed and notarized, interactive pkg installer for MacOS.

Using GitHub Actions

StackQL GitHub Actions are available for use in your GitHub Actions workflows. The following actions are available:

stackql-deploy

Deploy or test infrastructure stacks using StackQL directly from your GitHub workflows. This action enables Infrastructure as Code (IaC) workflows using SQL-like syntax, allowing you to define, deploy, and manage cloud resources across multiple providers in a single workflow.


Example usage

...
jobs:
stackql-actions-test:
name: StackQL Actions Test
runs-on: ubuntu-latest
env:
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} # add additional cloud provider creds here as needed

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Deploy a Stack
uses: stackql/stackql-deploy-action@v1.0.2
with:
command: 'build'
stack_dir: 'examples/k8s-the-hard-way'
stack_env: 'dev'
env_vars: 'GOOGLE_PROJECT=stackql-k8s-the-hard-way-demo'

Other Libraries

StackQL provides several integration methods that allow you for use in different programming languages and environments. These libraries extend StackQL's functionality, making it easy to incorporate cloud resource querying and management into your existing applications and workflows.

pystackql Python Package

Python wrapper to use StackQL in your Python programs. The pystackql package is available on PyPi, documentation for the pystackql package is available via Read the Docs. To install the pystackql package, run the following command:

pip install pystackql

The following example shows the pystackql package used along with pandas to run StackQL queries and return the results to a pandas.DataFrame:

from pystackql import StackQL
import pandas as pd
region = "ap-southeast-2"
stackql = StackQL()

query = """
SELECT instance_type, COUNT(*) as num_instances
FROM aws.ec2.instances
WHERE region = '%s'
GROUP BY instance_type
""" % (region)

res = stackql.execute(query)
df = pd.read_json(res)
print(df)