Problem
When you attach a policy to a policy set in HCP Terraform or Terraform Enterprise, any parameters you previously configured on the policy set disappear.
Cause
This behavior occurs because Sentinel parameters are only supported for policy sets that are connected to a Version Control System (VCS) repository. Parameters configured on policy sets without a VCS connection are not retained when a policy is attached.
Solution
If you are not using a VCS-backed policy set, you can achieve the same functionality by using the HCP Terraform API. This process involves three sequential steps:
- Create a policy set via the API.
- Create a policy set version for the newly created policy set.
- Upload the policy set version content.
Additional Information
For more details on configuring parameters for policy sets, please refer to the blog post on Configuring Parameters for Business-Aware Policies.