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

Cannot create Conditional Access Policy with platform linux #777

Closed
soohonlee opened this issue Apr 26, 2022 · 3 comments · Fixed by #784
Closed

Cannot create Conditional Access Policy with platform linux #777

soohonlee opened this issue Apr 26, 2022 · 3 comments · Fixed by #784

Comments

@soohonlee
Copy link

soohonlee commented Apr 26, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritise this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritise the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureAD Provider) Version

Terraform v1.1.8
on windows_amd64

  • provider registry.terraform.io/hashicorp/azuread v2.21.0

Affected Resource(s)

  • azuread_conditional_access_policy

Terraform Configuration Files

resource "azuread_conditional_access_policy" "block_unknown_platforms" {
  display_name = "block access when using using unknown platforms"

  conditions {
    users {
      included_users  = ["All"]
    }

    applications {
      included_applications = ["All"]
    }

    locations {
      included_locations = ["All"]
    }

    platforms {
      included_platforms = ["all"]
      excluded_platforms = [
        "android",
        "macOS",
        "iOS",
        "windows",
        "linux"
      ]
    }

    client_app_types = ["all"]

  }

  grant_controls {
    built_in_controls = [
      "block"
    ]
    operator = "OR"
  }

  state = "enabledForReportingButNotEnforced"
}

Debug Output

Panic Output

Expected Behavior

The terraform plan should have produced an output similar to the below output which is produced when I comment out the platform linux:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # azuread_conditional_access_policy.block_unknown_platforms will be created
  + resource "azuread_conditional_access_policy" "block_unknown_platforms" {
      + display_name = "block access when using using unknown platforms"
      + id           = (known after apply)
      + state        = "enabledForReportingButNotEnforced"

      + conditions {
          + client_app_types = [
              + "all",
            ]

          + applications {
              + included_applications = [
                  + "All",
                ]
            }

          + locations {
              + included_locations = [
                  + "All",
                ]
            }

          + platforms {
              + excluded_platforms = [
                  + "android",
                  + "macOS",
                  + "iOS",
                  + "windows",
                ]
              + included_platforms = [
                  + "all",
                ]
            }

          + users {
              + included_users = [
                  + "All",
                ]
            }
        }

      + grant_controls {
          + built_in_controls = [
              + "block",
            ]
          + operator          = "OR"
        }
    }


Plan: 1 to add, 0 to change, 0 to destroy.

Actual Behavior

The below error was produced.


│ Error: expected conditions.0.platforms.0.excluded_platforms.4 to be one of [all android iOS macOS unknownFutureValue windows windowsPhone], got linux

│ with azuread_conditional_access_policy.block_unknown_platforms,
│ on 2302_DGSTD302_tests.tf line 24, in resource "azuread_conditional_access_policy" "block_unknown_platforms":
│ 24: "linux"

Steps to Reproduce

  1. terraform plan

Important Factoids

The conditionalAccessPlatforms resource in the Azure Graph API v1.0 now supports the value Linux as noted in the below reference.

References

@manicminer
Copy link
Contributor

@soohonlee Thanks for reporting, we'll add this in tomorrow's provider release.

@github-actions
Copy link

This functionality has been released in v2.22.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
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.