Terraform policy CLI
The Terraform policy CLI (tfpolicy) provides commands for validating and testing your policies locally before enforcing them in HCP Terraform.
Usage
$ tfpolicy [global options] <command> [command options] [arguments...]
Global flags
The following flags are available for all tfpolicy commands:
--help,-h- Show help information for the command--version,-v- Display the version of thetfpolicybinary
Available commands
test
Run policy tests to verify your policies work as expected.
$ tfpolicy test --policies=/path/to/policies
Refer to tfpolicy test command reference for detailed information.
validate
Validate the syntax of your policy files without running tests.
$ tfpolicy validate --policies=/path/to/policies
Refer to tfpolicy validate command reference for detailed information.
version
Display version information for the tfpolicy CLI.
$ tfpolicy version
Refer to tfpolicy version command reference for detailed information.
Installation
To install the Terraform Policy CLI, refer to Install the Terraform policy CLI.