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

bugfix: null value can't pass schema validation #465

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

ms-henglu
Copy link
Collaborator

@ms-henglu ms-henglu commented Apr 24, 2024

The PR fixes the validation error like the following config:

/*
│ embedded schema validation failed: the argument "body" is invalid:
│ `properties.distribution` is invalid, expect `string` but got `<nil>`
│ `properties.infrastructure` is invalid, expect `string` but got `<nil>`
│  You can try to update `azapi` provider to the latest version or disable the validation using the feature flag `schema_validation_enabled = false` within the resource block
*/

resource "azapi_resource" "connectedCluster" {
  type = "Microsoft.Kubernetes/connectedClusters@2024-01-01"
  name      = var.aksArcName
  parent_id = var.resourceGroup.id

  body = {
    kind = "ProvisionedCluster"
    properties = {
      aadProfile = {
        adminGroupObjectIDs = flatten(var.rbacAdminGroupObjectIds)
        enableAzureRBAC     = true
        tenantID            = var.azureRBACTenantId
      }
      agentPublicKeyCertificate = "" 
      azureHybridBenefit        = null
      distribution              = null
      infrastructure            = null
      privateLinkState          = null
      provisioningState         = null
    }
  }

  identity {
    type = "SystemAssigned"
  }

  location = var.resourceGroup.location
  }

  timeouts {}
}

@ms-henglu ms-henglu requested a review from magodo April 24, 2024 12:46
@ms-henglu ms-henglu merged commit 1bdb8df into main Apr 25, 2024
9 checks passed
@ms-henglu ms-henglu deleted the branch-240424-fix-validation-for-null-properties branch April 25, 2024 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants