Skip to content

Latest commit

 

History

History
68 lines (52 loc) · 2.34 KB

File metadata and controls

68 lines (52 loc) · 2.34 KB
page_title coderd_organization_group_sync Resource - terraform-provider-coderd
subcategory
description Group sync settings for an organization on the Coder deployment. Multiple instances of this resource for a single organization will conflict. ~> Warning This resource is only compatible with Coder version 2.16.0 https://github.com/coder/coder/releases/tag/v2.16.0 and later.

coderd_organization_group_sync (Resource)

Group sync settings for an organization on the Coder deployment. Multiple instances of this resource for a single organization will conflict.

~> Warning This resource is only compatible with Coder version 2.16.0 and later.

Example Usage

resource "coderd_organization_group_sync" "test" {
  organization_id     = coderd_organization.test.id
  field               = "groups"
  regex_filter        = "test_.*|admin_.*"
  auto_create_missing = false

  mapping = {
    "test_developers" = [coderd_group.test.id]
    "admin_users"     = [coderd_group.admins.id]
    "mixed_group"     = [coderd_group.test.id, coderd_group.admins.id]
  }
}

Schema

Required

  • field (String) The claim field that specifies what groups a user should be in.
  • mapping (Map of List of String) A map from OIDC group name to Coder group ID.
  • organization_id (String) The ID of the organization to configure group sync for.

Optional

  • auto_create_missing (Boolean) Controls whether groups will be created if they are missing. Defaults to false.
  • regex_filter (String) A regular expression that will be used to filter the groups returned by the OIDC provider. Any group not matched will be ignored.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# The ID supplied must be an organization UUID
$ terraform import coderd_organization_group_sync.main_group_sync <org-id>

Alternatively, in Terraform v1.5.0 and later, an import block can be used:

import {
  to = coderd_organization_group_sync.main_group_sync
  id = "<org-id>"
}