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_eventhub_authorization_rule "parsing segment "staticResourceGroups": expected the segment "resourcegroups" to be "resourceGroups"" #17426

Closed
1 task done
maikschwan opened this issue Jun 29, 2022 · 3 comments

Comments

@maikschwan
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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 Version

1.1.5

AzureRM Provider Version

3.11.0

Affected Resource(s)/Data Source(s)

azurerm_eventhub_authorization_rule

Terraform Configuration Files

resource "azurerm_eventhub_authorization_rule" "producer" {
  name                = somename
  eventhub_name       = eventhub
  namespace_name      = namespace
  resource_group_name = eventhubrg
  listen              = true
  send                = true
  manage              = false
}

Debug Output/Panic Output

azurerm_eventhub_authorization_rule.producer["XXXXXXXX"]: Refreshing state... [id=/subscriptions/XXXXXXXX/resourceGroups/XXXXXXXX/providers/Microsoft.EventHub/namespaces/XXXXXXXX/eventhubs/XXXXXXXX/authorizationRules/XXXXXXXX]
2022-06-29T07:07:29.492Z [DEBUG] provider.terraform-provider-azurerm_v3.11.0_x5: AzureRM Request:
GET /subscriptions/XXXXXXXX/resourceGroups/XXXXXXXX/providers/Microsoft.EventHub/namespaces/XXXXXXXX/eventhubs/XXXXXXXX/authorizationRules/XXXXXXXX?api-version=2017-04-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.18.1 (arm64-linux) go-autorest/v14.2.1 pandora/eventhubs/2017-04-01 HashiCorp Terraform/1.1.5 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Type: application/json; charset=utf-8
X-Ms-Authorization-Auxiliary:
X-Ms-Correlation-Request-Id: b3cf90ed-87d2-027d-4844-14615d54ea6a
Accept-Encoding: gzip: timestamp=2022-06-29T07:07:29.492Z
2022-06-29T07:07:29.869Z [DEBUG] provider.terraform-provider-azurerm_v3.11.0_x5: AzureRM Response for https://management.azure.com/subscriptions/XXXXXXXX/resourceGroups/XXXXXXXX/providers/Microsoft.EventHub/namespaces/XXXXXXXX/eventhubs/XXXXXXXX/authorizationRules/XXXXXXXX?api-version=2017-04-01:
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Wed, 29 Jun 2022 07:07:29 GMT
Expires: -1
Pragma: no-cache
Server: Microsoft-HTTPAPI/2.0
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: b3cf90ed-87d2-027d-4844-14615d54ea6a
X-Ms-Ratelimit-Remaining-Subscription-Reads: 11900
X-Ms-Request-Id: 9cb8de54-c815-4cdb-98b7-2fbe8b92aa32
X-Ms-Routing-Request-Id: GERMANYWESTCENTRAL:20220629T070729Z:9cb8de54-c815-4cdb-98b7-2fbe8b92aa32

{"id":"/subscriptions/XXXXXXXX/resourcegroups/XXXXXXXX/providers/Microsoft.EventHub/namespaces/XXXXXXXX/eventhubs/XXXXXXXX/authorizationrules/XXXXXXXX","name":"XXXXXXXX","type":"Microsoft.EventHub/Namespaces/EventHubs/AuthorizationRules","location":"XXXXXXXX","properties":{"rights":["Listen","Send"]}}: timestamp=2022-06-29T07:07:29.869Z

Expected Behaviour

No response

Actual Behaviour

Error during plan:

Error: parsing "/subscriptions/XXXXXXXXX/resourcegroups/XXXXXXXXX/providers/Microsoft.EventHub/namespaces/XXXXXXXXX/eventhubs/XXXXXXXXX/authorizationrules/XXXXXXXXX": parsing segment "staticResourceGroups": expected the segment "resourcegroups" to be "resourceGroups"

Steps to Reproduce

terraform plan

Important Factoids

No response

References

#14456 seems to describe the same issue for a different resource azurerm_user_assigned_identity.

@sinbai
Copy link
Contributor

sinbai commented Jul 4, 2022

@maikschwan thank you for opening this issue here. Unfortunately, I could not reproduce this issue with the following tf configuration and steps. Could you reproduce with it ? Could you provide a more complete tf configuration and reproduce steps to help reproduce and troubleshoot?

Terraform and AzureRM Provider Version:
image

Step1: Create the dependent resources for azurerm_eventhub_authorization_rule with the following tf configuration:

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "3.11.0"
    }
  }
}

provider "azurerm" {
  features {
  }
}


resource "azurerm_resource_group" "test" {
  name     = "rg-example"
  location = "eastus"
}

resource "azurerm_eventhub_namespace" "test" {
  name                = "eventhubnamespace-example"
  location            = azurerm_resource_group.test.location
  resource_group_name = azurerm_resource_group.test.name

  sku = "Standard"
}

resource "azurerm_eventhub" "test" {
  name                = "eventhub-example"
  namespace_name      = azurerm_eventhub_namespace.test.name
 
  resource_group_name = azurerm_resource_group.test.name

  partition_count   = 2
  message_retention = 1
}

Step2: In a new tf configuration file, create resource azurerm_eventhub_authorization_rule with the following tf configuration:

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "3.11.0"
    }
  }
}

provider "azurerm" {
  features {
  }
}


resource "azurerm_eventhub_authorization_rule" "test" {
  name                = "authorization-rule-test-example"
  namespace_name      = "eventhubnamespace-example"
  eventhub_name       = "eventhub-example"
  resource_group_name = "rg-example"

  listen = true
  send   = true
  manage = false
}

Actual: Run terraform plan => everything works smoothly. "resourceGroups" was returned instead of "resourcegroups", see terraform log below for detail:

2022-07-04T10:34:40.298+0800 [DEBUG] provider.terraform-provider-azurerm_v3.11.0_x5.exe: AzureRM Request:
GET /subscriptions/xxx/resourceGroups/rg-example/providers/Microsoft.EventHub/namespaces/eventhubnamespace-example/eventhubs/eventhub-example/authorizationRules/authorization-rule-test-example?api-version=2017-04-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.18.1 (amd64-windows) go-autorest/v14.2.1 pandora/eventhubs/2017-04-01 HashiCorp Terraform/1.1.5 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Type: application/json; charset=utf-8
X-Ms-Authorization-Auxiliary:
X-Ms-Correlation-Request-Id: 84d62459-8cde-fc8d-11b0-6270c4920c9e
Accept-Encoding: gzip: timestamp=2022-07-04T10:34:40.297+0800
2022-07-04T10:34:41.871+0800 [DEBUG] provider.terraform-provider-azurerm_v3.11.0_x5.exe: AzureRM Response for https://management.azure.com/subscriptions/xxx/resourceGroups/rg-example/providers/Microsoft.EventHub/namespaces/eventhubnamespace-example/eventhubs/eventhub-example/authorizationRules/authorization-rule-test-example?api-version=2017-04-01:
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Mon, 04 Jul 2022 02:34:40 GMT
Expires: -1
Pragma: no-cache
Server: Service-Bus-Resource-Provider/SN1
Server: Microsoft-HTTPAPI/2.0
Server-Sb: Service-Bus-Resource-Provider/SN1
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: 84d62459-8cde-fc8d-11b0-6270c4920c9e
X-Ms-Ratelimit-Remaining-Subscription-Reads: 11995
X-Ms-Request-Id: e9df52c9-04fd-4fa2-af32-5b173c84a39e_M7SN1_M7SN1
X-Ms-Routing-Request-Id: SOUTHEASTASIA:20220704T023441Z:be0908d6-98fa-40c2-b0ca-8694cc071276

{"id":"/subscriptions/xxx/resourceGroups/rg-example/providers/Microsoft.EventHub/namespaces/eventhubnamespace-example/eventhubs/eventhub-example/authorizationRules/authorization-rule-test-example","name":"authorization-rule-test-example","type":"Microsoft.EventHub/Namespaces/EventHubs/AuthorizationRules","location":"East US","properties":{"rights":["Listen","Send"]}}: timestamp=2022-07-04T10:34:41.869+0800

@maikschwan
Copy link
Author

@sinbai Thanks for the quick reply. After removing the resources from the state and running another import the error was gone. Root cause for the errors is still unclear to me, but I'm no longer able to reproduce it. Issues can be closed.

@github-actions
Copy link

github-actions bot commented Aug 4, 2022

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2022
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

4 participants