Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azuread_conditional_access_policy set built_in_controls to optional #1168

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

alexwilcox9
Copy link
Contributor

During some recent work I noticed you could not create a CA policy in terraform that only has a terms of use set and no other controls.

This is possible through the portal, the below policy is valid and with this modification applies successfully.

resource "azuread_conditional_access_policy" "tou" {
  display_name = "Require All Users agree to terms"
  state        = "disabled"

  conditions {
    client_app_types = ["all"]

    applications {
      included_applications = ["All"]
    }

    users {
      included_users = ["All"]
    }

    locations {
      included_locations = ["All"]
    }
  }

  grant_controls {
    operator                      = "OR"
    terms_of_use                  = ["<<TOU-GUID>>"]
  }
}

Creating a policy with neither field is not possible (at least not until authentication strengths are supported) so I have set it to at least one of built_in_controls or terms_of_use

Copy link
Contributor

@manicminer manicminer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @alexwilcox9, LGTM 👍

@manicminer manicminer merged commit 8cdcf7a into hashicorp:main Sep 14, 2023
7 checks passed
manicminer added a commit that referenced this pull request Sep 14, 2023
@github-actions
Copy link

This functionality has been released in v2.42.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants