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

ServiceHealth value error #3843

Closed
funnybirdman opened this issue Jul 12, 2019 · 3 comments
Closed

ServiceHealth value error #3843

funnybirdman opened this issue Jul 12, 2019 · 3 comments

Comments

@funnybirdman
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 v0.11.14

Affected Resource(s)

  • azurerm_monitor_activity_log_alert

Terraform Configuration Files

  name     = "example-resources"
  location = "West US"
}

resource "azurerm_monitor_action_group" "main" {
  name                = "example-actiongroup"
  resource_group_name = "${azurerm_resource_group.main.name}"
  short_name          = "p0action"

  webhook_receiver {
    name        = "callmyapi"
    service_uri = "http://example.com/alert"
  }
}

resource "azurerm_storage_account" "to_monitor" {
  name                     = "examplesa"
  resource_group_name      = "${azurerm_resource_group.main.name}"
  location                 = "${azurerm_resource_group.main.location}"
  account_tier             = "Standard"
  account_replication_type = "GRS"
}

resource "azurerm_monitor_activity_log_alert" "main" {
  name                = "example-activitylogalert"
  resource_group_name = "${azurerm_resource_group.main.name}"
  scopes              = ["${azurerm_resource_group.main.id}"]
  description         = "This alert will monitor a specific storage account updates."

   criteria {
    category       = "Service Health" #<--- this is the problem
  }

  action {
    action_group_id = "${azurerm_monitor_action_group.main.id}"

    webhook_properties = {
      from = "terraform"
    }
  }
}

Debug Output

NA it succeeds to create. There is no error reporting on Azure side it seems.

Panic Output

NA

Expected Behavior

In the created alert the condition should equal ServiceHealth

"condition": {
      "allOf": [
        {
          "containsAny": null,
          "equals": "ServiceHealth",
          "field": "category",
          "odata.type": null
        }
      ],
      "odata.type": null
    },

Actual Behavior

An alert was created with Service Health.

 "condition": {
     "allOf": [
       {
         "containsAny": null,
         "equals": "Service Health",
         "field": "category",
         "odata.type": null
       }
     ],
     "odata.type": null
   },

Steps to Reproduce

  1. terraform apply
  2. az monitor activity-log alert list

Important Factoids

Azure Public cloud

References

This cli command creates the proper output.
https://docs.microsoft.com/en-us/cli/azure/monitor/activity-log/alert?view=azure-cli-latest#examples

az monitor activity-log alert create -n {name} -g {resource-group} --condition category=ServiceHealth

I couldn't find an api doc listing the syntax, but this doc states it https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/service-health/alerts-activity-log-service-notifications.md

  • #0000
tylerd added a commit to tylerd/terraform-provider-azurerm that referenced this issue Oct 17, 2019
Space in "Service Health" category causes 500 error when executing REST call
tylerd added a commit to tylerd/terraform-provider-azurerm that referenced this issue Oct 18, 2019
Removing the space in Service Health
@tombuildsstuff tombuildsstuff added this to the v1.36.0 milestone Oct 18, 2019
tombuildsstuff added a commit that referenced this issue Oct 18, 2019
@tombuildsstuff
Copy link
Contributor

Fixed via #4646

@ghost
Copy link

ghost commented Oct 29, 2019

This has been released in version 1.36.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.36.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Nov 18, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants