terraform query (requires Terraform >= 1.14), so existing controls can be discovered and brought under Terraform management without hand-writing one import block per control.
The Kosli list endpoint does not return
policies_referencing, so when resource data is included in query results that attribute is always reported as an empty list. Archived controls are only returned when archived = true is set.Example usage
Placelist blocks in a .tfquery.hcl file and run terraform query (requires Terraform >= 1.14):
terraform query -generate-config-out=generated.tf to generate import blocks and resource configuration for the discovered controls. To manage the resulting controls, see the kosli_control resource.
Schema
Optional
archived(Boolean) Include archived controls in the results. Defaults tofalse.search(String) Case-insensitive substring to match against control names and identifiers.