skip to content
wihan.dev
view as markdown
browse the clerk docs

clerk_organization (Resource)

An organization of the instance. The organizations feature must be on (see clerk_instance_organization_settings).

Example Usage

terraform
resource "clerk_organization" "acme" {
  name                    = "Acme"
  slug                    = "acme"
  max_allowed_memberships = 25

  public_metadata = jsonencode({
    tier = "enterprise"
  })
}

Schema

Required

  • name (String) Organization name.

Optional

  • admin_delete_enabled (Boolean) Allow organization admins to delete the organization. Defaults to true.
  • created_by (String) User id of the creator. Create-only: a change forces a replacement. When set, Clerk adds this user as the first admin member. Clerk uses it only on create, so if you remove it, the state keeps the creator.
  • max_allowed_memberships (Number) Maximum members. 0 means unlimited. If you do not set it, Clerk copies the instance default from clerk_instance_organization_settings. If you remove it later, the organization keeps its current value.
  • private_metadata (String) JSON object, visible to the backend only. Defaults to {}.
  • public_metadata (String) JSON object, visible to the frontend. Defaults to {}.
  • slug (String) URL-safe slug. If you do not set it, Clerk makes one from the name. If you remove it later, the organization keeps its current slug.

Read-Only

  • id (String) Organization id (org_...).

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

shell
terraform import clerk_organization.acme org_2abcDEFghiJKLmnoPQRstuVWXyz