Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IoT hub endpoint created assuming same resource group #3295

Closed
ukphillips opened this issue Apr 22, 2019 · 3 comments · Fixed by #8032
Closed

IoT hub endpoint created assuming same resource group #3295

ukphillips opened this issue Apr 22, 2019 · 3 comments · Fixed by #8032

Comments

@ukphillips
Copy link

Community Note

  • Please vote on this issue by adding a 👍 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

Terraform (and AzureRM Provider) Version

Terraform v0.11.13

  • provider.azurerm v1.23.0

Affected Resource(s)

IoT Hub

  • azurerm_iothub

Terraform Configuration Files

resource "azurerm_iothub" "module" {
  name                = "${var.hubname}-iothub"
  resource_group_name = "${var.resource_group_name}"
  location            = "${var.location}"

  sku {
    name     = "${var.iothub_sku_name}"
    tier     = "${var.iothub_sku_tier}"
    capacity = "${var.iothub_sku_capacity}"
  }

  endpoint {
    type              = "AzureIotHub.ServiceBusQueue"
    connection_string = "${var.sb-queue-endpoint-connection-string}"
    name              = "myevent-queue"
  }

  route {
    name           = "myevent"
    source         = "DeviceMessages"
    condition      = "$body.eventType = 'myevent'"
    endpoint_names = ["myevent-queue"]
    enabled        = true
  }
}

Created successfully

Panic Output

N/A

Expected Behavior

Custom endpoint should be created on IoT hub

Actual Behavior

Custom endpoint appears created, but when you drill into it, there is a not found message. Upon drilling into the resources in the resource explorer:

image

My test12 queue was manually created in the portal, and is correct, but the one above it (created by TF) is created with the assumption that the servicebus will reside in the same resource group as the parent (which is the IoT hub), this is not correct and is failing to connect the resourced together properly.

I would expect there to be an optional override to specify a different resourcegrouo/subscriptionid for the queue. This also seems to be an issue with other endpoint resources as well.

Steps to Reproduce

  1. Create a servicebus queue
  2. Reference sb queue in an IoT endpoint

Important Factoids

N/A

References

  • #0000
@neil-yechenwei
Copy link
Contributor

Thanks for opening this issue. Seems currently terraform would use the resource group where iothub exists as the resource group of endpoint by default. So I made a fix to allow to specify the endpoint resource group. Hopes it would be helpful. Thanks.

@ghost
Copy link

ghost commented Oct 29, 2020

This has been released in version 2.34.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.34.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Nov 26, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants