All skills
hashicorp avatar

/terraform-policy

@516354c official
by hashicorphashicorp/agent-skills880 stars
130

Write, test, or convert Terraform Policy files (.policy.hcl, .policytest.hcl, Sentinel→tfpolicy). Triggers: policy.hcl, policytest, convert sentinel, tfpolicy, write a policy.

Use this Skill: https://skilld.dev/gh/hashicorp/agent-skills/terraform-policy

This session only. Nothing lands on disk.

examplesconversioneventbridge-custom-event-bus-should-have-attached-policyREADME.md

≈276 tokens on demand. Your agent reads this file only when SKILL.md points to it.

EventBridge Bus Must Have Attached Policy

Source Sentinel Policy

eventbridge-custom-event-bus-should-have-attached-policy.sentinel

Conversion Quality

Limited

Why this is only a partial conversion

The Sentinel version can compare planned event bus resources against planned policy resources cleanly inside its own collection-processing model. tfpolicy can approximate that by using core::getresources() and matching on event_bus_name, but this is not a full graph-aware translation.

Key translation notes

  • Related resources are discovered with core::getresources("aws_cloudwatch_event_bus_policy", {})
  • Matching is done by explicit value (event_bus_name) rather than graph/reference semantics
  • A top-level lookup map keeps the tfpolicy example readable and performant

Limitations encountered

  • This approach relies on resolved attribute values, not reference metadata
  • New resources with unresolved references may not match reliably on initial creation
  • core::getresources() is useful for scoped lookups but is not a full replacement for Sentinel graph traversal

Source: SKILL.md on GitHub

No alerts3d3 checks · Risk SAFE
  • Gen Agent Trust Hub3d

    This skill is safe and provides a comprehensive framework for authoring, testing, and converting Terraform Policies. It includes detailed security best practices, such as safe attribute handling and proper IAM policy enforcement, to help users create robust policies.

  • Socket3d

    No alerts

  • Snyk3d

    Risk: LOW · No issues

Signed by skilld at 516354c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated last week
Other metadata
metadata
{
  "lifecycle-status": "active",
  "copyright": "Copyright IBM Corp. 2026",
  "version": "0.1.0"
}

README badge

README badge for hashicorp/agent-skills/terraform-policy