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.6k stars 4.65k forks source link

Support of Azure monitor into azurerm_api_management_logger resource #20358

Open clequang opened 1 year ago

clequang commented 1 year ago

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 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

RachidAZ commented 1 year ago

+1

EntityBox commented 6 months ago

@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.

clequang commented 6 months ago

@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.

EntityBox commented 6 months ago

@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.