Open sergeibelov113 opened 1 year ago
hi @sergeibelov113 thanks for opening the issue! From the error message there seems to be some issue within the Azure. For further troubleshooting, I'd suggest:
TF_LOG
to DEBUG
, with this, the API request details including request URI and body as well as the correlation id will be printed out, which would be helpful with investigation.@sergeibelov113 thanks for sharing the further details. Unfortunately, I'm not able to find anything new with it, but during my test, I'm able to repro the same error code and message by creating azurerm_iothub_endpoint_eventhub
with a non-existing event hub. Would you mind double check if that's the same case? And below is a working example within my test environment, maybe you could give it a try in your environment and see if there is anything different. Lastly, the 504 error seems hiding some actual error at the service end, I'd suggest open a support ticket to Azure to see if they could find the root cause.
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "test" {
name = "test"
location = "westeurope"
}
resource "azurerm_eventhub_namespace" "test" {
name = "testnamespace"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
sku = "Basic"
}
resource "azurerm_eventhub" "test" {
name = "test"
namespace_name = azurerm_eventhub_namespace.test.name
resource_group_name = azurerm_resource_group.test.name
partition_count = 2
message_retention = 1
}
resource "azurerm_iothub" "test" {
name = "test"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
sku {
name = "B1"
capacity = "1"
}
identity {
type = "SystemAssigned"
}
}
resource "azurerm_role_assignment" "test_azure_event_hubs_data_sender_system" {
role_definition_name = "Azure Event Hubs Data Sender"
scope = azurerm_eventhub.test.id
principal_id = azurerm_iothub.test.identity[0].principal_id
}
resource "azurerm_iothub_endpoint_eventhub" "test" {
resource_group_name = azurerm_resource_group.test.name
iothub_id = azurerm_iothub.test.id
name = "testendpoint"
authentication_type = "identityBased"
endpoint_uri = "sb://${azurerm_eventhub_namespace.test.name}.servicebus.windows.net"
entity_path = azurerm_eventhub.test.name
depends_on = [
azurerm_role_assignment.test_azure_event_hubs_data_sender_system,
]
}
Is there an existing issue for this?
Community Note
Terraform Version
1.4.6
AzureRM Provider Version
3.58.0
Affected Resource(s)/Data Source(s)
azurerm_iothub_endpoint_eventhub
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
EventHub endpoints created
Actual Behaviour
EventHub endpoints not created created with the following error:
`Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
Terraform will perform the following actions:
module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["1"] will be created
resource "azurerm_iothub_endpoint_eventhub" "example" {
module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["2"] will be created
resource "azurerm_iothub_endpoint_eventhub" "example" {
module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["3"] will be created
Plan: 3 to add, 0 to change, 0 to destroy.`
module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["3"]: Still creating... [10m50s elapsed] module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["3"]: Still creating... [11m0s elapsed] module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["2"]: Still creating... [11m0s elapsed] module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["1"]: Still creating... [11m0s elapsed] module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["1"]: Still creating... [11m10s elapsed] module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["3"]: Still creating... [11m10s elapsed] module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["2"]: Still creating... [11m10s elapsed] module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["2"]: Still creating... [11m20s elapsed] module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["1"]: Still creating... [11m20s elapsed] module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["3"]: Still creating... [11m20s elapsed] module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["2"]: Still creating... [11m30s elapsed] module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["3"]: Still creating... [11m30s elapsed] module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["1"]: Still creating... [11m30s elapsed] ╷ │ Error: creating/updating Endpoint Eventhub: (Endpoint Name "id-sergei-converter" / Iot Hub Name "XXXXXXXXXXXXXXXXX" / Resource Group "example-resources"): devices.IotHubResourceClient#CreateOrUpdate: Failure sending request: StatusCode=504 -- Original Error: Code="GatewayTimeout" Message="The gateway did not receive a response from 'Microsoft.Devices' within the specified time period." │ │ with module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["3"], │ on iothub-dps-chain/main.tf line 83, in resource "azurerm_iothub_endpoint_eventhub" "example": │ 83: resource "azurerm_iothub_endpoint_eventhub" "example" { │ ╵ ╷ │ Error: creating/updating Endpoint Eventhub: (Endpoint Name "id-sergei-converter" / Iot Hub Name "XXXXXXXXXXXXXXXX" / Resource Group "example-resources"): devices.IotHubResourceClient#CreateOrUpdate: Failure sending request: StatusCode=504 -- Original Error: Code="GatewayTimeout" Message="The gateway did not receive a response from 'Microsoft.Devices' within the specified time period." │ │ with module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["2"], │ on iothub-dps-chain/main.tf line 83, in resource "azurerm_iothub_endpoint_eventhub" "example": │ 83: resource "azurerm_iothub_endpoint_eventhub" "example" { │ ╵ ╷ │ Error: creating/updating Endpoint Eventhub: (Endpoint Name "id-sergei-converter" / Iot Hub Name "XXXXXXXXXXXX" / Resource Group "example-resources"): devices.IotHubResourceClient#CreateOrUpdate: Failure sending request: StatusCode=504 -- Original Error: Code="GatewayTimeout" Message="The gateway did not receive a response from 'Microsoft.Devices' within the specified time period." │ │ with module.iothub-dps-chain.azurerm_iothub_endpoint_eventhub.example["1"], │ on iothub-dps-chain/main.tf line 83, in resource "azurerm_iothub_endpoint_eventhub" "example": │ 83: resource "azurerm_iothub_endpoint_eventhub" "example" { │
Steps to Reproduce
No response
Important Factoids
No response
References
No response