diff --git a/docs/resources/conditional_access_policy.md b/docs/resources/conditional_access_policy.md index e97910e0e2..41a81c5da7 100644 --- a/docs/resources/conditional_access_policy.md +++ b/docs/resources/conditional_access_policy.md @@ -227,11 +227,13 @@ The following arguments are supported: `grant_controls` block supports the following: -* `built_in_controls` - (Required) List of built-in controls required by the policy. Possible values are: `block`, `mfa`, `approvedApplication`, `compliantApplication`, `compliantDevice`, `domainJoinedDevice`, `passwordChange` or `unknownFutureValue`. +* `built_in_controls` - (Optional) List of built-in controls required by the policy. Possible values are: `block`, `mfa`, `approvedApplication`, `compliantApplication`, `compliantDevice`, `domainJoinedDevice`, `passwordChange` or `unknownFutureValue`. * `custom_authentication_factors` - (Optional) List of custom controls IDs required by the policy. * `operator` - (Required) Defines the relationship of the grant controls. Possible values are: `AND`, `OR`. * `terms_of_use` - (Optional) List of terms of use IDs required by the policy. +-> At least one of `built_in_controls` or `terms_of_use` must be specified. + --- `session_controls` block supports the following: diff --git a/internal/services/conditionalaccess/conditional_access_policy_resource.go b/internal/services/conditionalaccess/conditional_access_policy_resource.go index 33359a5410..a299f826cf 100644 --- a/internal/services/conditionalaccess/conditional_access_policy_resource.go +++ b/internal/services/conditionalaccess/conditional_access_policy_resource.go @@ -387,8 +387,9 @@ func conditionalAccessPolicyResource() *schema.Resource { }, "built_in_controls": { - Type: schema.TypeList, - Required: true, + Type: schema.TypeList, + Optional: true, + AtLeastOneOf: []string{"grant_controls.0.built_in_controls", "grant_controls.0.terms_of_use"}, Elem: &schema.Schema{ Type: schema.TypeString, ValidateFunc: validation.StringInSlice([]string{ @@ -414,8 +415,9 @@ func conditionalAccessPolicyResource() *schema.Resource { }, "terms_of_use": { - Type: schema.TypeList, - Optional: true, + Type: schema.TypeList, + Optional: true, + AtLeastOneOf: []string{"grant_controls.0.built_in_controls", "grant_controls.0.terms_of_use"}, Elem: &schema.Schema{ Type: schema.TypeString, ValidateDiagFunc: validate.NoEmptyStrings,