
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.
Usage
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"]
}
Documentation
Reference for every resource and data source, plus guides, is on the
Terraform Registry.
Start here:
Documentation is generated: attribute text comes from MarkdownDescription in the schemas, page
prose from docs-templates/. Edit those and run make docs-generate — never edit docs/ directly.
Examples
Development
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 docs
Acceptance 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.
Contributing
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.
License
This project is licensed under the Mozilla Public License 2.0.