Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/resources/organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ resource "keycloak_oidc_identity_provider" "this" {
- `alias` - (Optional) The alias unique identifies the organization. Same as the name if not specified. The alias cannot be changed after the organization has been created.
- `description` - (Optional) The description of the organization.
- `redirect_url` - (Optional) The landing page after user completes registration or accepts an invitation to the organization. If left empty, the user will be redirected to the account console by default.
- `domain` - (Required) A list of [domains](#domain-arguments). At least one domain is required.
- `domain` - (Optional) A list of [domains](#domain-arguments).
- `attributes` - (Optional) A map representing attributes for the group. In order to add multivalued attributes, use `##` to separate the values. Max length for each value is 255 chars.

### Domain arguments
Expand Down
7 changes: 2 additions & 5 deletions provider/resource_keycloak_organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ func resourceKeycloakOrganization() *schema.Resource {
},
"domain": {
Type: schema.TypeSet,
Required: true,
MinItems: 1,
Optional: true,
MinItems: 0,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Expand Down Expand Up @@ -104,9 +104,6 @@ func getOrganizationFromData(data *schema.ResourceData) (*keycloak.Organization,
}
}

if len(domains) == 0 {
return nil, fmt.Errorf("at least one domain is required")
}
organization.Domains = domains

attributes := map[string][]string{}
Expand Down