| name | tfdc-policy-search |
| description | Search Terraform policy sets using tfdc. Use when you need to find Sentinel or OPA policy sets by keyword, discover CIS benchmarks or compliance policies, or get policy IDs for use with tfdc policy get. |
tfdc policy search
Search Terraform policy sets.
Usage
tfdc policy search -query <keyword> [-format text]
Flags
| Flag | Required | Default | Description |
|---|
-query | Yes | | Search query (e.g., cis, aws, networking) |
-format | No | text | Output format: text, json, markdown |
Output fields
| Field | Description |
|---|
terraform_policy_id | Policy ID in policies/namespace/name/version format |
name | Policy set name |
title | Policy set title |
downloads | Download count |
Examples
tfdc policy search -query cis
tfdc policy search -query aws -format json
JSON output
{
"items": [
{
"terraform_policy_id": "policies/hashicorp/CIS-Policy-Set-for-AWS-Terraform/1.0.1",
"name": "CIS-Policy-Set-for-AWS-Terraform",
"title": "Pre-written Sentinel Policies for AWS CIS Foundations Benchmarking",
"downloads": 647442
}
],
"total": 1
}
Workflow
Use with tfdc policy get to fetch full policy details:
tfdc policy search -query cis -format json | jq '.items[].terraform_policy_id'
tfdc policy get -id policies/hashicorp/CIS-Policy-Set-for-AWS-Terraform/1.0.1