hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.59k stars 4.63k forks source link

azurerm_monitor_activity_log_alert has incorrect allowed values for recommendation_category #23569

Closed PlanetWilson closed 1 year ago

PlanetWilson commented 1 year ago

Is there an existing issue for this?

Community Note

Terraform Version

1.5.7

AzureRM Provider Version

3.76

Affected Resource(s)/Data Source(s)

azurerm_monitor_activity_log_alert

Terraform Configuration Files

resource "azurerm_monitor_activity_log_alert" "ar_sub_advisor_test" {
  description         = ""
  enabled             = true
  name                = "ar-secmon-sub-advisortest"
  resource_group_name = "rg-alerting"
  scopes              = ["/subscriptions/11111111-1111-1111-1111-111111111111"]

  action {
    action_group_id    = azurerm_monitor_action_group.ag_sub_email_1.id
    webhook_properties = {}
  }
  criteria {
    category                = "Recommendation"
    operation_name          = "Microsoft.Advisor/recommendations/available/action"
    recommendation_category = "HighAvailability"
    recommendation_impact   = "High"
  }
}

Debug Output/Panic Output

╷
│ Error: expected criteria.0.recommendation_category to be one of ["Cost" "Reliability" "OperationalExcellence" "Performance"], got HighAvailability
│ 
│   with azurerm_monitor_activity_log_alert.ar_sub_advisor_3,
│   on secmon.alerting.tf line 214, in resource "azurerm_monitor_activity_log_alert" "ar_sub_advisor_3":
│  214:     recommendation_category = "HighAvailability"

Expected Behaviour

The alert rule should have been created with a recommendation_category of HighAvailability

Actual Behaviour

HighAvailability is a valid option for recommendation_category. Reliability is no longer an option if you look in the Azure Portal.

Steps to Reproduce

terraform apply with a snippet like above

Important Factoids

No response

References

No response

teowa commented 1 year ago

Hi @PlanetWilson , from Azure Portal it still looks like this for recommandation category, could you please share where the HighAvailbility comes from? image

PlanetWilson commented 1 year ago

Well that is bizarre, this is what I see:-

image

github-actions[bot] commented 5 months ago

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.