Sentinel — HashiCorp policy language for validating Terraform plan.
Example:
1import "tfplan/v2" as tfplan23allowed_types = ["t3.micro", "t3.small", "t3.medium"]45violations = filter tfplan.resource_changes as _, rc {6 rc.type is "aws_instance" and7 (rc.change.actions contains "create" or rc.change.actions contains "update") and8 not rc.change.after.instance_type in allowed_types9}1011main = rule {12 length(violations) is 013}
Enforcement Levels:
Alternatives: OPA/Conftest, Checkov, tfsec.