scalr_policy_group

Resource: scalr_policy_group

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"
  }
}

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)

Optional

  • account_id (String) The identifier of the Scalr account, in the format acc-<RANDOM STRING>.
  • environments (List 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)
  • status (String) A system status of the Policy group.

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.

Nested Schema for policies

Read-Only:

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

Import

Import is supported using the following syntax:

terraform import scalr_policy_group.example pgrp-xxxxxxxxxx