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

azurerm_iothub always discovers changes when an endopint is set in the configuration #2494

Closed
IvanovOleg opened this issue Dec 12, 2018 · 5 comments

Comments

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

  • provider.azurerm v1.19.0
  • provider.helm v0.6.2
  • provider.ignition v1.0.1
  • provider.local v1.1.0
  • provider.template v1.0.0
  • provider.tls v1.2.0

Affected Resource(s)

  • azurerm_iothub

Terraform Configuration Files

resource "azurerm_iothub" "main" {
  name                = "${var.environment}-${var.project}-iot"
  resource_group_name = "${azurerm_resource_group.main.name}"
  location            = "${azurerm_resource_group.main.location}"

  sku {
    name     = "${var.iot_hub_sku_name}"
    tier     = "${var.iot_hub_sku_tier}"
    capacity = "${var.iot_hub_sku_capacity}"
  }

  endpoint {
    type              = "AzureIotHub.ServiceBusQueue"
    connection_string = "${azurerm_servicebus_queue_authorization_rule.test.primary_connection_string}"
    name              = "test"
  }

  route {
    name           = "test"
    source         = "DeviceMessages"
    condition      = "tenantId = 'test'"
    endpoint_names = ["test"]
    enabled        = true
  }
}
# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

Debug Output

Panic Output

Expected Behavior

Actual Behavior

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  ~ azurerm_iothub.main
      endpoint.0.batch_frequency_in_seconds: "0" => "300"
      endpoint.0.connection_string:          "Endpoint=sb://XXXXXXX.servicebus.windows.net:5671/;SharedAccessKeyName=XXXX;SharedAccessKey=****;EntityPath=XXXX" => "Endpoint=sb://XXXXX.servicebus.windows.net/;SharedAccessKeyName=XXXX;SharedAccessKey=XXXXXXXXXXX"
      endpoint.0.max_chunk_size_in_bytes:    "0" => "314572800"
      endpoint.0.type:                       "" => "AzureIotHub.ServiceBusQueue"

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@IvanovOleg IvanovOleg changed the title azurerm_iothub always sees changes when an endopint is set in the configuration azurerm_iothub always discovers changes when an endopint is set in the configuration Dec 12, 2018
@Lucretius
Copy link
Contributor

@tombuildsstuff I believe this was solved by #2951

@nekoruri
Copy link

nekoruri commented Oct 27, 2019

I found failed case that terraform always discovers changes:

"DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=accountname;AccountKey=****"
=> "DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=;EndpointSuffix=core.windows.net"
( is masked by me )

AccountKey mask algorithm( #2951 ) works, but changed order of parameters.

@neil-yechenwei
Copy link
Contributor

@IvanovOleg , thanks for opening this issue. After tested with latest azurerm and below tfconfig, seems I cannot repro it anymore. Could you have a try latest azurerm and below tfconfig to check whether the issue still exists? Thanks.

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "test" {
  name     = "acctestRG-iothub-test10"
  location = "eastus2"
}

resource "azurerm_eventhub_namespace" "test" {
  resource_group_name = "${azurerm_resource_group.test.name}"
  location            = "${azurerm_resource_group.test.location}"
  name                = "acctest-en-test10"
  sku                 = "Basic"
}

resource "azurerm_eventhub" "test" {
  name                = "acctest-eh-test10"
  resource_group_name = "${azurerm_resource_group.test.name}"
  namespace_name      = "${azurerm_eventhub_namespace.test.name}"
  partition_count     = 2
  message_retention   = 1
}

resource "azurerm_eventhub_authorization_rule" "test" {
  resource_group_name = "${azurerm_resource_group.test.name}"
  namespace_name      = "${azurerm_eventhub_namespace.test.name}"
  eventhub_name       = "${azurerm_eventhub.test.name}"
  name                = "acctesteartest10"
  send                = true
}

resource "azurerm_iothub" "test" {
  name                = "acctestIoTHub-test10"
  resource_group_name = "${azurerm_resource_group.test.name}"
  location            = "${azurerm_resource_group.test.location}"

  sku {
    name     = "S1"
    capacity = "1"
  }

  endpoint {
    type              = "AzureIotHub.ServiceBusQueue"
    connection_string = "${azurerm_eventhub_authorization_rule.test.primary_connection_string}"
    name              = "export2"
  }
  
  route {
    name           = "test"
    source         = "DeviceMessages"
    condition      = "tenantId = 'test'"
    endpoint_names = ["export2"]
    enabled        = true
  }
}

@katbyte
Copy link
Collaborator

katbyte commented Sep 29, 2020

Hi @IvanovOleg - it seems like this was fixed by #2951, as such i am going to close this issue. PLease open a new one if i've closed this in error.

@katbyte katbyte closed this as completed Sep 29, 2020
@ghost
Copy link

ghost commented Oct 29, 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 Oct 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants