can we use terraform validator policy code in OPA policy testing #324
rakesh0022
started this conversation in
Community
Replies: 2 comments 1 reply
-
To clarify, @rakesh0022 , you have a terraform-validator Rego policy, which reads a YAML file, and validates it? |
Beta Was this translation helpful? Give feedback.
1 reply
-
If you want to evaluate those policies using only OPA, you'll need to get the Rego bits out of the YAML files first. You could even do so using OPA itself :) opa eval -f raw -d policy.yaml 'data.spec.targets["validation.gcp.forsetisecurity.org"].rego' But.. you'd still need to provide the parameters from the template as part of the input when evaluating that policy. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
I am looking here to check, if we can use the same policy which we were using with terraform validator (are written in rego), however it saved as .yaml extension with OPA policy
we are trying to migrate from terraform validator to opa, and we already have all the policy in written in rego with terraform validator and want to check if all the same policy can be used with OPA. or we will need to write all the policy from scratch for opa
Thanks
Beta Was this translation helpful? Give feedback.
All reactions