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_activity_log_alert - support for service_health #10978

Merged
merged 11 commits into from
Apr 15, 2021

Conversation

HappyTobi
Copy link
Contributor

Hi all,

just a small pr to add more fine grained settings for "ServiceHealth" alerts.

I changed:

  • Add new Rest API for Log Alerts
  • Add Documentation for fine grained settings
  • Add new ServiceHealth Settings
  • Add Tests

New TF style to setup ServiceHealth

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 = "ServiceHealth"    
    servicehealth {
      events   = ["Incident", "Maintenance"]
      regions  = ["Global", "West Europe"]
      services = ["App Service (Linux)", "Network Infrastructure"]
    }
  }

  action {
    action_group_id = azurerm_monitor_action_group.main.id
  }
}

Added requested feature from issues:
#2996, #7392

Regards,
Tobi

Copy link
Contributor

@ArcturusZhang ArcturusZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @HappyTobi thanks for this PR!
I just left some minor comments, could you please take a look? Thanks

@HappyTobi
Copy link
Contributor Author

Hi @ArcturusZhang, @tombuildsstuff

I updated the code and the documentation.

Think it's fine now.

Regards,

@@ -96,6 +96,15 @@ A `criteria` block supports the following:
* `recommendation_type` - (Optional) The recommendation type of the event. It is only allowed when `category` is `Recommendation`.
* `recommendation_category` - (Optional) The recommendation category of the event. Possible values are `Cost`, `Reliability`, `OperationalExcellence` and `Performance`. It is only allowed when `category` is `Recommendation`.
* `recommendation_impact` - (Optional) The recommendation impact of the event. Possible values are `High`, `Medium` and `Low`. It is only allowed when `category` is `Recommendation`.
* `servicehealth` - (Optional) A block to define fine grain service health settings.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is supposed to be service_health.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will update the docs

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these changes deployed ? if it is yes then how can I use this fine granular piece of code ? Because right now it is giving error "Blocks of type "servicehealth" are not expected here."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skyflash711 no it's an PR er have to wait till it's reviewed and merged.

After that, a comment from the bot will be added with the version where feature is part of.

@ClaudiaBaur
Copy link

Is there anything open why this PR cannot be merged? Just asking as we are waiting to consume it... Thanks!

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @HappyTobi! Thanks for opening up this PR. It's on the right track but there are a few things I've highlighted below that will need resolved before we can merge

@HappyTobi HappyTobi requested a review from mbfrahry April 15, 2021 16:39
@mbfrahry mbfrahry changed the title azurerm_monitor_activity_log_alert add fine grained settings for service health azurerm_monitor_activity_log_alert - support for service_health Apr 15, 2021
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for this @HappyTobi

@mbfrahry mbfrahry added this to the v2.56.0 milestone Apr 15, 2021
@ghost
Copy link

ghost commented Apr 16, 2021

This has been released in version 2.56.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 = "~> 2.56.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented May 16, 2021

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 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators May 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants