Write a Sentinel policy for a Terraform deployment
Create filters and rules for your governance requirements with the Sentinel policy language.
Use case
Enforce policies before your users create infrastructure using Sentinel policy as code.
Challenge
Rapid provisioning opens up tremendous possibilities, but organizations need to maintain security and prevent over provisioning.
Solution
HCP Terraform can help you enforce policies on the types of resources teams can provision and use. Ticket-based review processes are a bottleneck that can slow down development. Instead, you can use HashiCorp Sentinel, a policy as code framework, to automatically enforce compliance and governance policies before Terraform makes infrastructure changes.
Create filters and rules for your governance requirements with the Sentinel policy language.
Write a soft-mandatory Sentinel policy against example infrastructure to limit its cost to less than $100 a month.
Create and upload a Sentinel policy set. Apply the policy set to your HCP Terraform organization.
Sentinel policies can be created for every stage of the Terraform workflow, including the configuration, plan, run, and state.
Sentinel Policies are rules which are enforced on Terraform runs to validate that the plan and corresponding resources are in compliance with company policies.
An important part of the test process is mocking the data that you wish your policies to operate on.