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_notification_hub_authorization_rule attempt to create multiple rules in one go fails #4085

Closed
andrey-dubnik opened this issue Aug 14, 2019 · 2 comments

Comments

@andrey-dubnik
Copy link
Contributor

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.12.6

  • provider.azurerm v1.32.1

Affected Resource(s)

azurerm_notification_hub_authorization_rule

Terraform Configuration Files

resource "azurerm_notification_hub_authorization_rule" "hosting" {
  for_each = {
      authrule_1 = {
                  listen = true
                  },
      authrule_2 = {
                  send = true
                  },
      authrule_3 = {
                  manage = true
                  }
  }
  notification_hub_name = var.notificationhub_name
  namespace_name      = var.notificationhub_namespace_name
  name                = each.key

  resource_group_name = var.resource_group_name

  listen    = (lookup(each.value, "manage", null) != null ? true : lookup(each.value, "listen", null))
  send      = (lookup(each.value, "manage", null) != null ? true : lookup(each.value, "send", null))
  manage    = lookup(each.value, "manage", null)
}

Debug Output

# module.notificationhubnamespace.azurerm_notification_hub_authorization_rule.hosting["authrule_1"]: Creating... |  
-- | --
  | # module.notificationhubnamespace.azurerm_notification_hub_authorization_rule.hosting["authrule_2"]: Creating... |  
  | # module.notificationhubnamespace.azurerm_notification_hub_authorization_rule.hosting["authrule_3"]: Creation complete after 6s [id=/subscriptions/***/resourceGroups/***/providers/Microsoft.NotificationHubs/namespaces/nhnazewtmlit001tftest/notificationHubs/nhazewtmlit001tftest/AuthorizationRules/authrule_3] |  
  | # |  
  | # Error: Error retrieving Authorization Rule "authrule_1" (Notification Hub "nhazewtmlit001tftest" / Namespace "nhnazewtmlit001tftest" / Resource Group "***"): notificationhubs.Client#GetAuthorizationRule: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="NotFound" Message="The requested resource authrule_1 does not exist." |  
  | # |  
  | #   on ../../../main.tf line 66, in resource "azurerm_notification_hub_authorization_rule" "hosting": |  
  | #   66: resource "azurerm_notification_hub_authorization_rule" "hosting" { |  
  | # |  
  | # |  
  | # |  
  | # Error: Error retrieving Authorization Rule "authrule_2" (Notification Hub "nhazewtmlit001tftest" / Namespace "nhnazewtmlit001tftest" / Resource Group "***"): notificationhubs.Client#GetAuthorizationRule: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="NotFound" Message="The requested resource authrule_2 does not exist."

Panic Output

Expected Behavior

Multiple rules should be created

Actual Behavior

creates 1 rule and produces 404 for the rest

Steps to Reproduce

  1. terraform apply

Important Factoids

References

@andrey-dubnik
Copy link
Contributor Author

I will submit PR for the issue as I have one fixed by applying the retry logic to the rule creation as it seem create API returns Ok where resource was not actually created...

@ghost
Copy link

ghost commented Dec 21, 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 Dec 21, 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

3 participants