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_monitor_diagnostic_setting error parsing segment "staticAuthorizationRules" #15549

Closed
adamevans-ns opened this issue Feb 22, 2022 · 2 comments · Fixed by #15582
Closed

Comments

@adamevans-ns
Copy link

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 (and AzureRM Provider) Version

Terraform 1.0.4
AzureRM Provider 2.87 onwards

Affected Resource(s)

  • azurerm_monitor_diagnostic_setting

Terraform Configuration Files

# Apologies for adhoc code, our code is across multiple child modules. Needs resources for an Eventhub namespace and hub in order test.

locals {
    diagnostic_map                   = {
        eh_auth_id                   = "${var.eventhub.namespace_id}/authorizationRules/RootManageSharedAccessKey"
        eh_log_name                  = "az-diag-logs"
    }
    activity_log_categories          = [
        "Administrative",
        "Security",
        "ServiceHealth",
        "Alert",
        "Recommendation",
        "Policy",
        "Autoscale",
        "ResourceHealth"
    ]
}

resource "azurerm_monitor_diagnostic_setting" "activity_logs" {
    name                             = "default-activity-log"
    target_resource_id               = "/subscriptions/${var.subscription_id}"
    eventhub_authorization_rule_id   = local.diagnostic_map.eh_auth_id
    eventhub_name                    = local.diagnostic_map.eh_log_name

    dynamic "log" {
        for_each                     = toset(local.activity_log_categories)
        content {
            category                 = log.key
            enabled                  = true
        }
    }
}

Debug Output

Code can only run via pipelines in my environment so don't have access to debug output at present.

Expected Behaviour

Diagnostic settings are deployed to the subsription

Actual Behaviour

Terraform plan fails on existing or new environments

Error: parsing "/subscriptions/***/resourceGroups/event-hub/providers/Microsoft.EventHub/namespaces/evn-dev/authorizationrules/RootManageSharedAccessKey": parsing segment "staticAuthorizationRules": expected the segment "authorizationrules" to be "authorizationRules"

Steps to Reproduce

  1. terraform plan

Important Factoids

N/A

References

Seems to have been an issue since parse checks on the authorization rules were changed to case sensitive.

@github-actions
Copy link

This functionality has been released in v2.99.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 Apr 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants