Resource Overview

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

Example Usage

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"



  • 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)


  • account_id (String) The identifier of the Scalr account, in the format acc-<RANDOM STRING>.
  • opa_version (String) The version of Open Policy Agent to run policies against. If omitted, the system default version is assigned.


  • environments (List of String) A list of the environments the policy group is linked to.
  • 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)
  • status (String) A system status of the Policy group.

Nested Schema for vcs_repo


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


  • 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.

Nested Schema for policies


  • enabled (Boolean)
  • enforced_level (String)
  • name (String)


Import is supported using the following syntax:

terraform import scalr_policy_group.example pgrp-xxxxxxxxxx