Can't import tfplan/v2

Hello

Struggleling to understand how sentinel policy can apply on a plan.

I am testing this pretty modest policy:

import “tfplan/v2” as tfplan

main = rule {
true
}

But get:

policy.sentinel - Runtime error while running the policy:

policy.sentinel:1:1: Import "tfplan/v2" is not available

A runtime error is a non-recoverable error due to some unexpected or invalid condition. When a runtime error is experienced, the result of the policy is "false".

What I am doing wrong?
thanks

Hi @fmirouze please visit this github GitHub - hashicorp/terraform-sentinel-policies: Example Sentinel Policies for use with Terraform Cloud and Terraform Enterprise

for better undertanding, and also you can run some example from there with some mock that already there as well

Hi,

If you are attempting to work with any of the Terraform imports, I highly recommend reading through the terraform feature documentation.

What is likely stopping it from working for you currently is that you may have not enabled the terraform feature within your configuration. Please read the sentinel configuration section and let me know if that helps.

Thanks,

Cameron