terraform-provider-azurerm
terraform-provider-azurerm copied to clipboard
Support of Azure monitor into azurerm_api_management_logger resource
Is there an existing issue for this?
- [X] I have searched the existing issues
Community Note
- Please vote on this issue by adding a :thumbsup: 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
Description
The Logger Type "azureMonitor" is available in the Microsoft REST API contract that allows creating/updating an API Management logger : https://learn.microsoft.com/en-us/rest/api/apimanagement/current-ga/logger/create-or-update?tabs=HTTP
I cannot find a way to set this logger type into the current Terraform documentation or the latest version of azurerm_api_management_logger.
If I don't set an AppInsights or an Event Hub property which are both "(Optional)", Terraform raised this error :
Error: Either eventhub
or application_insights
is required
New or Affected Resource(s)/Data Source(s)
azurerm_api_management_logger
Potential Terraform Configuration
No response
References
No response
+1
@clequang - If you look at the same Microsoft documentation you listed, the Request Body has a LoggerType that is required. If you expand LoggerType (on the bottom of the documentation) you will see that either ApplicationInsights, EventHubs or AzureMonitor should be listed.
Terraform AzureRM Provicer should just update their documentation stating the same: Either eventhub or application_insights is required but not both
Found this whilst looking at other errors I found on the azurerm_api_management_logger resource. Hope this helps.
@EntityBox Actually, I would like to set the LoggerType value to "AzureMonitor" and the actual azurerm_api_management_logger resource doesn't allow it as you cannot specify "AzureMonitor" anywhere. Then, if you don't set anything (ApplicationInsights or EventHubs both not set), we have the error message.
@clequang I suppose you will have to wait for the azurerm to be extended by HCL. Latest version also does not have AzureMonitor as an option.