azurerm_monitor_action_group_data_source
constructs incorrect event_hub_id
#17091
Closed
1 task done
Labels
Is there an existing issue for this?
Community Note
Terraform Version
v1.1.9
AzureRM Provider Version
3.9.0
Affected Resource(s)/Data Source(s)
azurerm_monitor_action_group_data_source
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
When I apply the same terraform configuration files for the second time no changes should be detected.
Actual Behaviour
The data source incorrect uses the resource group of the monitor action group to construct the
event_hub_id
. This is incorrect as in the provided configuration the event hub is in another resource group.The problem seems to originate from the way the
event_hub_receiver
is modelled. The Terraform AzureRM provider uses a resource idevent_hub_id
as input. Azure RM itself does not expect a full Eventhub resource id but only usestenantId
,subscriptionId
,eventHubNameSpace
,eventHubName
. See API definition. As a result theazurerm_monitor_action_group_data_source
cannot reconstruct a full resource id that is expected byevent_hub_id
.The current implementation uses the resource group of the action group to construct the resource id, but this is only correct if the eventhub and action group are in the same resource group which will be rarely the case.
Wouldn't it be better to use the same input as Azure RM uses for
event_hub_receiver
? So instead of a singleevent_hub_id
allow the input oftenant_id
,subscription_id
,event_hub_name_space
andevent_hub_name
.Steps to Reproduce
terraform apply
terraform apply
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: