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

azurerm_automation_software_update_configuration invalid request #23622

Open
1 task done
DevopsMercenary opened this issue Oct 19, 2023 · 3 comments
Open
1 task done

Comments

@DevopsMercenary
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

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

Terraform Version

1.5.7

AzureRM Provider Version

3.76.0

Affected Resource(s)/Data Source(s)

azurerm_automation_software_update_configuration

Terraform Configuration Files

resource "azurerm_automation_account" "default" {

  name = "${azurerm_linux_virtual_machine.-host.name}vmupdate"

  location            = azurerm_resource_group.default.location
  resource_group_name = azurerm_resource_group.default.name
  sku_name            = "Basic"

  tags = local.tag-map
  lifecycle {
    ignore_changes = [
      tags,
    ]
  }
}



resource "azurerm_automation_software_update_configuration" "default" {

  name                  = azurerm_linux_virtual_machine.-host.name
  automation_account_id = azurerm_automation_account.default.id

  linux {
    classification_included = "Security"
    reboot                  = "IfRequired"
  }

  virtual_machine_ids = [azurerm_linux_virtual_machine.-host.id]


  schedule {
    frequency          = "Week"
    interval           = 1
    is_enabled         = true
    advanced_week_days = ["Sunday"]
    time_zone          = "America/New_York"
  }

  duration = "PT2H2M2S"
}


### Debug Output/Panic Output

```shell
│ Error: creating Software Update Configuration (Subscription: "0f849332-18f0-45f6-abf6-3bcd9058d3eb"
│ Resource Group Name: "host"
│ Automation Account Name: "hostvmupdate"
│ Software Update Configuration Name: "host"): softwareupdateconfiguration.SoftwareUpdateConfigurationClient#Create: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="{\"Message\":\"The request is invalid.\",\"ModelState\":{\"softwareUpdateConfiguration.properties.updateConfiguration\":[\"Software update configuration should specify Classification or IncludedPackageNameMask for any reboot setting other than 'RebootOnly'.\"]}}"
│
│   with azurerm_automation_software_update_configuration.default,
│   on auto-update-automation.tf line 21, in resource "azurerm_automation_software_update_configuration" "default":
│   21: resource "azurerm_automation_software_update_configuration" "default" {
│
│ creating Software Update Configuration (Subscription: "0f849332-18f0-45f6-abf6-3bcd9058d3eb"
│ Resource Group Name: "host"
│ Automation Account Name: "hostvmupdate"
│ Software Update Configuration Name: "host"): softwareupdateconfiguration.SoftwareUpdateConfigurationClient#Create: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest"
│ Message="{\"Message\":\"The request is invalid.\",\"ModelState\":{\"softwareUpdateConfiguration.properties.updateConfiguration\":[\"Software update configuration should specify Classification or IncludedPackageNameMask for any reboot setting other than
│ 'RebootOnly'.\"]}}"

Expected Behaviour

azurerm_automation_software_update_configuration.default: Creating...
azurerm_automation_software_update_configuration.default: Creation complete after 1s [id=/subscriptions/0f849332-18f0-45f6-abf6-3bcd9058d3eb/resourceGroups/host/providers/Microsoft.Automation/automationAccounts/hostvmupdate/softwareUpdateConfigurations/host]
Releasing state lock. This may take a few moments...

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Actual Behaviour

See debug output

Steps to Reproduce

terraform apply

Important Factoids

N/A

References

No response

@DevopsMercenary
Copy link
Author

Downgrade to 3.75.0 works fine

@wuxu92
Copy link
Contributor

wuxu92 commented Oct 20, 2023

Hi @DevopsMercenary Thanks for filing this issue. This is a known break that #23564 has fixed it. Could you please have a try with v3.77.0 when it is released? Also, you can use classifications_included, instead of deprecated classification_included, to specify the classification property which should works in the latest 3.76.0 version.

  linux {
    classifications_included = ["Security"]
    reboot                  = "IfRequired"
  }

@DevopsMercenary
Copy link
Author

Thanks. I'll verify this in a little bit.

Please update the docs. The example code is still classification_included = "Security"

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/automation_software_update_configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants