[AVM Module Issue]: Setting mismatch in API version #39
Labels
Language: Terraform 🌐
This is related to the Terraform IaC language
Needs: Triage 🔍
Maintainers need to triage still
Type: Bug 🐛
Something isn't working
Check for previous/existing GitHub issues
Issue Type?
Bug
(Optional) Module Version
2.0.0
(Optional) Correlation Id
No response
Description
When running Terraform apply we get the issue below which states that the attribute "secrets" in the deployment data is not expected. When reviewing the API version, the "Secrets" attribute is not present in the API ("Microsoft.AzureStackHCI/clusters/deploymentSettings@2024-01-01"). However, the setting is present in the latest API version ("Microsoft.AzureStackHCI/clusters/deploymentSettings@2024-02-15-preview"). If we comment out the "secrets" attribute in the deploymentData block we then get the second error below.
FIRST ERROR
│ Error: Invalid configuration
│
│ with module.hci.azapi_resource.validatedeploymentsetting,
│ on .terraform\modules\hci\validate.tf line 11, in resource "azapi_resource" "validatedeploymentsetting":
│ 11: resource "azapi_resource" "validatedeploymentsetting" {
│
│ embedded schema validation failed: the argument "body" is invalid:
│
properties.deploymentConfiguration.scaleUnits.0.deploymentData.secrets
is not expected here. Do you meanproperties.deploymentConfiguration.scaleUnits.0.deploymentData.storage
?│ You can try to update
azapi
provider to the latest version or disable the validation using the feature flagschema_validation_enabled = false
within the resource blockSECOND ERROR
Error: Failed to create/update resource
│
│ with module.avm-res-azurestackhci-cluster.azapi_resource.validatedeploymentsetting,
│ on .terraform\modules\avm-res-azurestackhci-cluster\validate.tf line 11, in resource "azapi_resource" "validatedeploymentsetting":
│ 11: resource "azapi_resource" "validatedeploymentsetting" {
│
│ creating/updating Resource: (ResourceId "/subscriptions/749e7196-fb97-4a3f-bc66-f80d3863cb4e/resourceGroups/App-Dev-Ground/providers/Microsoft.AzureStackHCI/clusters/hcicluster1/deploymentSettings/default" / Api Version
│ "2024-01-01"): GET [https://management.azure.com/providers/Microsoft.AzureStackHCI/locations/REMOVED>/operationStatuses/REMOVED>(https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmanagement.azure.com%2Fproviders%2FMicrosoft.AzureStackHCI%2Flocations%2REMOVED>FoperationStatuses%2F8REMOVED>
│ --------------------------------------------------------------------------------
│ RESPONSE 200: 200 OK
│ ERROR CODE: UpdateDeploymentSettingsDataFailed
│ --------------------------------------------------------------------------------
│ {
│ "id": "/providers/Microsoft.AzureStackHCI/locations//operationStatuses/
│ "name": "",
│ "resourceId": "/subscriptions/REMOVED>/resourceGroups//providers/Microsoft.AzureStackHCI/clusters/hcicluster1/deploymentSettings/default",
│ "status": "Failed",
│ "error": {
│ "code": "UpdateDeploymentSettingsDataFailed",
│ "message": "Deployment Settings validation failed.",
│ "details": [
│ {
│ "code": "UpdateDeploymentSettingsDataFailed",
│ "target": "/subscriptions/REMOVED>/resourceGroups//providers/Microsoft.AzureStackHCI/clusters/hcicluster1",
│ "message": "Failed to create deployment settings. \nValidation status is {Status=Error, Steps={Name=Error, Description=Error executing Request: Validate, FullStepIndex=0, StartTimeUtc=3/6/2025 4:16:05 AM, EndTimeUtc=NA, Status=Error, Exception=Exception: One or more errors occurred. at: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r\n at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)\r\n at Microsoft.AzureStack.Solution.Deploy.LCMController.ArcCommunication.ActionPlanController.ExecuteRequest(Request request) Base Exception: Could not make the arm call with inner error = at: at EdgeCommonClient.EdgeArmClient.MakeArmCall(HttpMethod httpMethod, String resourceId, String apiVersion, String content)\r\n at Microsoft.AzureStack.Solution.Deploy.LCMController.ArcCommunication.ECELiteConfigurationService.GetDeploymentSettings(Request message)\r\n at Microsoft.AzureStack.Solution.Deploy.LCMController.ArcCommunication.ActionPlanController.d__4.MoveNext(), Steps=}}. \nDeployment Status is {Status=, Steps=null}"
│ }
│ ]
│ }
│ }
The text was updated successfully, but these errors were encountered: