hashicorp / terraform-provider-azuread

Terraform provider for Azure Active Directory
https://registry.terraform.io/providers/hashicorp/azuread/latest/docs
Mozilla Public License 2.0
428 stars 294 forks source link

`azuread_claims_mapping_policy`: support the "description" property #771

Open Flasheh opened 2 years ago

Flasheh commented 2 years ago

Community Note

Terraform (and AzureAD Provider) Version

❯ terraform -v
Terraform v1.1.8
on linux_amd64
+ provider [registry.terraform.io/hashicorp/azuread](http://registry.terraform.io/hashicorp/azuread) v2.20.0
+ provider [registry.terraform.io/hashicorp/azurerm](http://registry.terraform.io/hashicorp/azurerm) v3.1.0

Affected Resource(s)

Terraform Configuration Files

resource "azuread_claims_mapping_policy" "my_policy" {
  definition = [
    jsonencode(
      {
        ClaimsMappingPolicy = {
          ClaimsSchema = [
            {
              ID            = "employeeid"
              JwtClaimType  = "name"
              SamlClaimType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
              Source        = "user"
            },
            {
              ID            = "tenantcountry"
              JwtClaimType  = "country"
              SamlClaimType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country"
              Source        = "company"
            }
          ]
          IncludeBasicClaimSet = "true"
          Version              = 1
        }
      }
    ),
  ]
  description  = "Policy created with Terraform"
  display_name = "My Policy"
}

Expected Behavior

The resource should accept a description attribute

description - (Required) The description for this Claims Mapping Policy.

Actual Behavior

The resource does not accept a description attribute.

Error: Unsupported argument on claims_policies.tf line 50, in resource "azuread_claims_mapping_policy" "my_policy": 50: description = "Policy created with Terraform"

An argument named "description" is not expected here.

Looking at the PR It seems that the description attribute was in the schemas at first but then removed. So either the documentation should be updated, or the description field added to the schema again I suppose.

Flasheh commented 2 years ago

There's a PR already open to remove the description attribute. I missed it before creating this issue.

https://github.com/hashicorp/terraform-provider-azuread/pull/769

manicminer commented 2 years ago

Hi @Flasheh, thanks for reporting. As you noted, this is a documentation bug as we don't support the description property at this time due to an API bug.

However, I'm happy to leave this open to track this and we'll circle back in future to see if this gets unblocked. Thanks!