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 Error in scope when its at subscription level #18835

Closed
1 task done
RAWRitsCloud opened this issue Oct 18, 2022 · 3 comments · Fixed by #18860
Closed
1 task done

Comments

@RAWRitsCloud
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

Terraform Version

1.3.2

AzureRM Provider Version

3.25.0

Affected Resource(s)/Data Source(s)

azurerm_automation_software_update_configuration

Terraform Configuration Files

resource "azurerm_automation_software_update_configuration" "windowsUpdateGroupManagement" {
  name                  = "wino24AM"
  automation_account_id = var.es_input["automation_account_id"]
  operating_system      = "Windows"
  duration              = "PT6H0M"

  windows {
    classifications_included        = ["Critical", "Security"]
    excluded_knowledge_base_numbers = var.windows_excluded_kbs
    reboot                          = "IfRequired"
  }

  schedule {
    is_enabled  = true
    frequency   = "Month"
    description = "wino24AM Schedule"
    interval    = 1
    start_time  = var.period == "AM" ? "${formatdate("YYYY-MM-DD", timeadd(timestamp(), "24h"))}T00:00:00Z" : "${formatdate("YYYY-MM-DD", timeadd(timestamp(), "24h"))}T18:00:00Z"
    time_zone   = "Europe/London"

    monthly_occurrence {
      day        = var.day
      occurrence = tonumber(keys(var.weekOccurance)[0])
    }
  }

  target {
    azure_query {
      locations = var.es_input["locations"]
      scope     = ["/subscription/GUIDSUBSCIRPTION"]
      tags {
        tag    = "updateManagementGroup"
        values = ["wino24AM"]
      }
      tags {
        tag    = "updateManagementMethod"
        values = ["Azure Automation"]
      }
      tag_filter = "All"
    }
  }
}

Debug Output/Panic Output

│ Error: ID was missing the 'resourceGroups' element
│ 
│   with module.updateManagement[0].azurerm_automation_software_update_configuration.windowsUpdateGroupManagement["o24AM"],
│   on .terraform\modules\updateManagement\res-updategroup.tf line 34, in resource "azurerm_automation_software_update_configuration" "windowsUpdateGroupManagement":
│   34:       scope     = ["/subscription/GUIDSUBSCIRPTION"]

Expected Behaviour

I would expect it to be able to have a scope of just the whole subscription, I was doing this via an API call and it worked fine and as an ARM Template

Actual Behaviour

It seems to not validate that there is no Resource Group but it doesn't need one

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@wuxu92
Copy link
Contributor

wuxu92 commented Oct 19, 2022

Hi @RAWRitsCloud thanks for your feedback it is confirmed a bug of azurerm. I have submitted a PR to fix it. and another reminder that the format of the subscription id should be /subscriptions/xxx-xxx

@github-actions
Copy link

This functionality has been released in v3.28.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 Nov 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants