Open clequang opened 1 year ago
+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 applicationinsights 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.
Is there an existing issue for this?
Community Note
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
orapplication_insights
is required_New or Affected Resource(s)/Data Source(s)
azurerm_api_management_logger
Potential Terraform Configuration
No response
References
No response