The StackGuardian Terraform Provider allows Terraform to programmatically interact with the StackGuardian API to help you manage resources on the StackGuardian platform, ultimately enabling organizations to manage cloud infrastructure in a cost-efficient, secure, and compliant way.
Tip
Looking for ready-to-use examples? All StackGuardian Terraform modules and examples are maintained in the terraform-stackguardian-modules repository.
The provider is available on the Terraform Registry:
terraform {
required_providers {
stackguardian = {
source = "StackGuardian/stackguardian"
version = "~> 1.12"
}
}
}
provider "stackguardian" {
api_key = "<YOUR-API-KEY>" # or env var STACKGUARDIAN_API_KEY
org_name = "<YOUR-ORG-NAME>" # or env var STACKGUARDIAN_ORG_NAME
api_uri = "https://api.app.stackguardian.io" # or env var STACKGUARDIAN_API_URI; use "https://api.us.stackguardian.io" for the US region
}
resource "stackguardian_workflow_group" "example" {
resource_name = "Simple-Workflow-Group"
description = "Example of how to create a workflow group using the StackGuardian Terraform Provider"
tags = ["tf-provider-example", "example"]
}The full list of supported resources and data sources, with documentation for each, is available on the Terraform Registry.
- terraform-stackguardian-modules — the collection of StackGuardian Terraform modules and examples.
- Quickstart guide — a minimal working configuration to get started.
- Onboarding examples — end-to-end projects covering connectors, workflow groups, roles, and role assignments.
Requirements:
make build # compile the provider binary
make install # build and install into ~/.terraform.d/plugins for local use
make test # run unit tests
make test-acc # run acceptance tests (see below)
make docs-generate # regenerate docs with tfplugindocs
make docs-validate # validate generated docsAcceptance tests run against a real StackGuardian organization and require:
export TF_ACC=1
export STACKGUARDIAN_API_KEY=<key>
export STACKGUARDIAN_API_URI=<uri>
export STACKGUARDIAN_ORG_NAME=<org>Release notes for each version are in the CHANGELOG and on the GitHub releases page.
Contributions are welcome — please see CONTRIBUTING.md for guidelines and the Code of Conduct for community standards. Use GitHub issues to report bugs or request features.
This project is licensed under the Mozilla Public License 2.0.