> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/infrastructure-as-code-management/platform/policy-and-governance/terraform-plan-cost-policy.md).

# Built-in Policies

You can add policies and assign them to policy sets to add protective steps that run in conjunction with your IaCM pipelines, evaluating changes and either forcing the pipeline to fail or warning you about conditions that have not been met by your IaCM policy set.

### Plan Cost Policies <a href="#plan-cost-policies" id="plan-cost-policies"></a>

In this example, you can add and configure a built-in `terraform plan cost` policy that will pass or fail if the total monthly cost of your proposed infrastructure state is greater than a specified amount.

{% tabs %}
{% tab title="Interactive guide" %}
{% embed url="<https://app.tango.us/app/embed/3fd9f721-938a-478e-84cc-d8c88f0e3544>" %}
{% endtab %}

{% tab title="Step-by-step" %}
To add a new Terraform Plan Cost policy and assign it to a policy set, follow these steps:

#### Add a new policy <a href="#add-a-new-policy" id="add-a-new-policy"></a>

1. Sign in to [app.harness.io](https://app.harness.io), then select **Project Settings**.
2. Scroll down and select **Policies**.
3. Select **Policies**, then select **New Policy**.
4. Name your policy and select **Apply**.
5. Search the sample policies library for `terraform plan cost`.
6. Select **Terraform Plan Cost - Total Cost Estimate**, then select **Use this sample**.
7. Inspect the sample and edit the amount accordingly.
8. Select **Test** to test the policy against the provided sample data, focusing specifically on **TotalMonthlyCost**.
9. Select **Save**.

#### Add the policy to a policy set <a href="#add-the-policy-to-a-policy-set" id="add-the-policy-to-a-policy-set"></a>

1. Select **Policy sets**.
2. Select **New policy set**.
3. Name your policy set.
4. Select **Terraform Plan Cost** from the entity type list.
5. Select **Continue**.
   {% endtab %}
   {% endtabs %}

#### Re-review a plan policy <a href="#re-review-a-plan-policy" id="re-review-a-plan-policy"></a>

You can review a previously executed plan against a policy after a plan step has been executed to help determine why it failed.

{% tabs %}
{% tab title="Interactive guide" %}
{% embed url="<https://app.tango.us/app/embed/453f5786-ba92-4f0f-be09-182af4e67637>" %}
{% endtab %}

{% tab title="Step-by-step" %}
To compare your previously executed Terraform plan step against a policy, follow these steps:

1. Select **Policy sets** then select **Policies**.
2. Select **Policies**, then select the policy you want to review your previously executed plan step against.
3. Click **Select input**.
4. Select the **Entity type**, **Organization**, **Project** and **Action** to search for and filter your pipeline executions.
5. Select **Apply**.
6. Review your policy TotalMonthlyCost amount against the TotalMonthlyCost of your Terraform plan input.
   {% endtab %}
   {% endtabs %}
