Skip to main content
Manages a Kosli policy. Policies define artifact compliance requirements (provenance, trail-compliance, attestations) that can be attached to environments. Policies are versioned and immutable: updating content or description creates a new version rather than modifying the existing one.
Deleting this resource removes it from Terraform state only. Kosli has no API endpoint to delete policies, so the policy will remain in Kosli after terraform destroy. To attach policies to environments, use the kosli_policy_attachment resource.

Example usage

Import

Policies can be imported using their name:

Schema

Required

  • content (String) YAML content of the policy, conforming to the Kosli policy schema (_schema: https://docs.kosli.com/schemas/policy/v1). Supports heredoc syntax for multi-line YAML. Updating this value creates a new policy version.
  • name (String) Name of the policy. Must be unique within the organization. Changing this will force recreation of the resource.

Optional

  • description (String) Description of the policy.

Read-only

  • created_at (Number) Unix timestamp of when the policy was first created.
  • latest_version (Number) The version number of the latest policy version. Null if the policy has no versions.
Last modified on April 17, 2026