Introduction
When utilizing static imports with Hashicorp Sentinel, it is desirable to also add that data to tests without duplication.
Prerequisites (if applicable)
- Sentinel v.19 or newer
Procedure
-
In order to successfully import static data into sentinel tests, the path to the data will need to be indicated in each test file.
- Though static imports are effectively similar, they are imported in a way that is distinct from 'mocking data as static' outlined in the documentation
# excerpt from example test file
import "static" "example" {
source ="../../data/my-static-import"
format = "json"
}