---
updatedAt: 2025-10-23T13:07:16.000Z
agentTools:
  projectIndex: https://docs.scalr.io/llms.txt
---

# scalr_policy_group

## Resource: scalr\_policy\_group

Manage the state of policy groups in Scalr. Create, update and destroy.

## Example Usage

```terraform
resource "scalr_policy_group" "example" {
  name            = "instance_types"
  opa_version     = "0.29.4"
  account_id      = "acc-xxxxxxxxxx"
  vcs_provider_id = "vcs-xxxxxxxxxx"
  vcs_repo {
    identifier = "org/repo"
    path       = "policies/instance"
    branch     = "dev"
  }
}
```

## Schema

### Required

* `name` (String) The name of a policy group.
* `vcs_provider_id` (String) The identifier of a VCS provider, in the format `vcs-<RANDOM STRING>`.
* `vcs_repo` (Block List, Min: 1, Max: 1) The VCS meta-data to create the policy from. (see [below for nested schema](#nestedblock--vcs_repo))

### Optional

* `account_id` (String) The identifier of the Scalr account, in the format `acc-<RANDOM STRING>`.
* `common_functions_folder` (String) An absolute path from the repository root to the folder that contains common rego functions.
* `environments` (Set of String) A list of the environments the policy group is linked to. Use `["*"]` to enforce in all environments. To manage a linkage use either this attribute or the `scalr_policy_group_linkage` resource.
* `opa_version` (String) The version of Open Policy Agent to run policies against. If omitted, the system default version is assigned.

### Read-Only

* `error_message` (String) A detailed error if Scalr failed to process the policy group.
* `id` (String) The ID of this resource.
* `policies` (List of Object) A list of the OPA policies the group verifies each run. (see [below for nested schema](#nestedatt--policies))
* `status` (String) A system status of the Policy group.

<a id="nestedblock--vcs_repo"></a>

### Nested Schema for `vcs_repo`

Required:

* `identifier` (String) The reference to the VCS repository in the format `:org/:repo`, this refers to the organization and repository in your VCS provider.

Optional:

* `branch` (String) The branch of a repository the policy group is associated with. If omitted, the repository default branch will be used.
* `path` (String) The subdirectory of the VCS repository where OPA policies are stored. If omitted or submitted as an empty string, this defaults to the repository's root.

<a id="nestedatt--policies"></a>

### Nested Schema for `policies`

Read-Only:

* `enabled` (Boolean)
* `enforced_level` (String)
* `name` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import scalr_policy_group.example pgrp-xxxxxxxxxx
```

# Sibling pages

* [scalr\_endpoint](https://docs.scalr.io/scalr/docs/provider_resource_scalr_endpoint.md)
* [scalr\_access\_policy](https://docs.scalr.io/scalr/docs/provider_resource_scalr_access_policy.md)
* [scalr\_account\_allowed\_ips](https://docs.scalr.io/scalr/docs/provider_resource_scalr_account_allowed_ips.md)
* [scalr\_agent\_pool](https://docs.scalr.io/scalr/docs/provider_resource_scalr_agent_pool.md)
* [scalr\_agent\_pool\_token](https://docs.scalr.io/scalr/docs/provider_resource_scalr_agent_pool_token.md)
* [scalr\_assume\_service\_account\_policy](https://docs.scalr.io/scalr/docs/provider_resource_scalr_assume_service_account_policy.md)
* [scalr\_checkov\_integration](https://docs.scalr.io/scalr/docs/provider_resource_scalr_checkov_integration.md)
* [scalr\_drift\_detection](https://docs.scalr.io/scalr/docs/provider_resource_scalr_drift_detection.md)
* [scalr\_environment](https://docs.scalr.io/scalr/docs/provider_resource_scalr_environment.md)
* [scalr\_environment\_hook](https://docs.scalr.io/scalr/docs/provider_resource_scalr_environment_hook.md)
* [scalr\_event\_bridge\_integration](https://docs.scalr.io/scalr/docs/provider_resource_scalr_event_bridge_integration.md)
* [scalr\_federated\_environments](https://docs.scalr.io/scalr/docs/provider_resource_scalr_federated_environments.md)
* [scalr\_hook](https://docs.scalr.io/scalr/docs/provider_resource_scalr_hook.md)
* [scalr\_iam\_team](https://docs.scalr.io/scalr/docs/provider_resource_scalr_iam_team.md)
* [scalr\_integration\_infracost](https://docs.scalr.io/scalr/docs/provider_resource_scalr_integration_infracost.md)
* [scalr\_module](https://docs.scalr.io/scalr/docs/provider_resource_scalr_module.md)
* [scalr\_module\_namespace](https://docs.scalr.io/scalr/docs/provider_resource_scalr_module_namespace.md)
* [scalr\_policy\_group\_linkage](https://docs.scalr.io/scalr/docs/provider_resource_scalr_policy_group_linkage.md)
* [scalr\_provider\_configuration](https://docs.scalr.io/scalr/docs/provider_resource_scalr_provider_configuration.md)
* [scalr\_provider\_configuration\_default](https://docs.scalr.io/scalr/docs/provider_resource_scalr_provider_configuration_default.md)
* [scalr\_role](https://docs.scalr.io/scalr/docs/provider_resource_scalr_role.md)
* [scalr\_run\_schedule\_rule](https://docs.scalr.io/scalr/docs/provider_resource_scalr_run_schedule_rule.md)
* [scalr\_run\_trigger](https://docs.scalr.io/scalr/docs/provider_resource_scalr_run_trigger.md)
* [scalr\_service\_account](https://docs.scalr.io/scalr/docs/provider_resource_scalr_service_account.md)
* [scalr\_service\_account\_token](https://docs.scalr.io/scalr/docs/provider_resource_scalr_service_account_token.md)
* [scalr\_slack\_integration](https://docs.scalr.io/scalr/docs/provider_resource_scalr_slack_integration.md)
* [scalr\_ssh\_key](https://docs.scalr.io/scalr/docs/provider_resource_scalr_ssh_key.md)
* [scalr\_storage\_profile](https://docs.scalr.io/scalr/docs/provider_resource_scalr_storage_profile.md)
* [scalr\_tag](https://docs.scalr.io/scalr/docs/provider_resource_scalr_tag.md)
* [scalr\_var\_set](https://docs.scalr.io/scalr/docs/provider_resource_scalr_var_set.md)
* [scalr\_variable](https://docs.scalr.io/scalr/docs/provider_resource_scalr_variable.md)
* [scalr\_vcs\_provider](https://docs.scalr.io/scalr/docs/provider_resource_scalr_vcs_provider.md)
* [scalr\_webhook](https://docs.scalr.io/scalr/docs/provider_resource_scalr_webhook.md)
* [scalr\_workload\_identity\_provider](https://docs.scalr.io/scalr/docs/provider_resource_scalr_workload_identity_provider.md)
* [scalr\_workspace](https://docs.scalr.io/scalr/docs/provider_resource_scalr_workspace.md)
* [scalr\_workspace\_run\_schedule](https://docs.scalr.io/scalr/docs/provider_resource_scalr_workspace_run_schedule.md)
* [scalr\_workspace\_var\_set](https://docs.scalr.io/scalr/docs/provider_resource_scalr_workspace_var_set.md)