stackql-deploy 2.0 - Rewritten in Rust
stackql-deploy 2.0 is a full rewrite in Rust. The Python package (stackql-deploy on PyPi) is archived at 1.9.4. CLI interface and stack file format are unchanged - no migration required.
Why Rust
The move to Rust was primarily about distribution and operational simplicity. Rust also brings stronger guarantees around performance and memory safety. Running everything in-process without Foreign Function Interface (FFI) boundaries simplifies the architecture while maintaining predictable resource usage.
Embedded Postgres Wire Protocol Server
The most significant functional change in 2.0 is that stackql-deploy now runs the StackQL engine as an embedded in-process server over a local postgres wire protocol connection rather than shelling out to the StackQL binary as an external process.
There is nothing to start, stop, or configure. The server is lifecycle-managed by stackql-deploy itself and binds to localhost only - no port is exposed on the network, no inbound firewall rules needed in CI.
The previous model spawned a new StackQL process per operation. The embedded server keeps a persistent connection for the duration of a deployment run. For stacks with many resources, the reduction in process spawn overhead is noticeable - particularly on Windows where process creation is expensive.
Additional Features Added
In addition to added the architectural change to use the embedded server, several other workflow improvements were added including:
- Enabling resource scoped variable exports in
/*+ exists */queries: When an exists query returns a named field (e.g.vpc_id) instead ofcount, the value is captured as a resource-scoped variable (this.vpc_id) and made available to all subsequent queries for that resource (e.g. statecheck, exports). This eliminates the need for redundant lookups to resolve resource identifiers between query stages. - Support for capturing
RETURNINGpayloads from DML operations:INSERT,UPDATE, andDELETEstatements can include aRETURNINGclause. Fields from the response can be mapped to resource-scoped variables viareturn_valsin the manifest, keyed by operation (create,update,delete). This allows identifiers assigned by the provider during creation to be used immediately without a round-trip query. - Additional template filters: Including the
to_aws_tag_filtersfilter, which convertsglobal_tagsto the AWS Resource Groups Tagging APITagFiltersformat, and type-preserving YAML-to-JSON serialization that maintains string types through the rendering pipeline. - Improved logging and exception handling: Enhanced visibility simplifying troubleshooting.
Installation
- Linux / macOS
- Windows
- GitHub Releases
- GitHub Actions
- Cargo
The canonical install URL detects your OS and redirects to the latest release asset automatically. You can also download directly from your browser at get-stackql-deploy.io.
curl -L https://get-stackql-deploy.io | tar xzf -
Use the PowerShell script below or download directly from your browser at get-stackql-deploy.io.
Invoke-WebRequest https://get-stackql-deploy.io -OutFile stackql-deploy.zip
Expand-Archive stackql-deploy.zip -DestinationPath .
Pre-built binaries are attached to every release on the releases page. A SHA256SUMS file is included for verification.
| Platform | Asset |
|---|---|
| Linux x86_64 | stackql-deploy-linux-x86_64.tar.gz |
| Linux arm64 | stackql-deploy-linux-arm64.tar.gz |
| macOS Universal (Apple Silicon + Intel) | stackql-deploy-macos-universal.tar.gz |
| Windows x86_64 | stackql-deploy-windows-x86_64.zip |
Use the stackql/stackql-deploy-action to run build or test commands in your CI pipeline. Provider credentials are passed via environment variables sourced from GitHub Actions Secrets.
Deploy a stack:
jobs:
deploy:
runs-on: ubuntu-latest
env:
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
steps:
- uses: actions/checkout@v4
- uses: stackql/stackql-deploy-action@v2
with:
command: 'build'
stack_dir: 'examples/my-stack'
stack_env: 'prod'
env_vars: 'GOOGLE_PROJECT=my-project'
Deploy and capture outputs:
- name: Deploy Stack
id: stackql-deploy
uses: stackql/stackql-deploy-action@v2
with:
command: 'build'
stack_dir: 'examples/my-stack'
stack_env: 'prod'
output_file: 'deployment-outputs.json'
env_vars: 'GOOGLE_PROJECT=my-project'
- name: Use outputs
run: |
echo '${{ steps.stackql-deploy.outputs.deployment_outputs }}' | jq .
See the stackql-deploy-action repo or the GitHub Action Marketplace for the full input/output reference.
If you have the Rust toolchain installed (rustup is the recommended way to get it on any platform), cargo install builds and installs the binary directly from crates.io.
cargo install stackql-deploy
Usage
The CLI interface is unchanged from the Python version:
# deploy a stack
stackql-deploy build my-stack prod \
--e GOOGLE_PROJECT=${GOOGLE_PROJECT}
# test a stack
stackql-deploy test my-stack prod \
--e GOOGLE_PROJECT=${GOOGLE_PROJECT}
# tear down a stack
stackql-deploy teardown my-stack prod \
--e GOOGLE_PROJECT=${GOOGLE_PROJECT}
# dry run
stackql-deploy build my-stack prod \
--e GOOGLE_PROJECT=${GOOGLE_PROJECT} \
--dry-run
Stack files and stackql_manifest.yml structure are unaffected - no migration work needed.
Python Package Deprecation
stackql-deploy 1.9.4 on PyPi is the final Python release. The Python source repository is archived. If you have pip install stackql-deploy in any scripts or CI pipelines, replace it with one of the install methods above. The 1.9.4 package remains on PyPi and installable, but will not receive updates.
Links
- GitHub: github.com/stackql/stackql-deploy
- crates.io: crates.io/crates/stackql-deploy
- StackQL docs: stackql.io/docs