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

Applying Multiple Redis Firewall Rules Failing #2830

Closed
ghost opened this issue Feb 1, 2019 · 1 comment · Fixed by #3731
Closed

Applying Multiple Redis Firewall Rules Failing #2830

ghost opened this issue Feb 1, 2019 · 1 comment · Fixed by #3731

Comments

@ghost
Copy link

ghost commented Feb 1, 2019

This issue was originally opened by @paulmchenry as hashicorp/terraform#20197. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

  • Terraform v0.11.11
  • provider.azurerm v1.21.0

Terraform Configuration Files

resource "azurerm_redis_cache" "redis" {
  name                = "redis"
  location            = "${azurerm_resource_group.compute-group.location}"
  resource_group_name = "${azurerm_resource_group.compute-group.name}"
  capacity            = 0
  family              = "C"
  sku_name            = "Basic"
  enable_non_ssl_port = false

  redis_configuration {}
}

resource "azurerm_redis_firewall_rule" "redis-fwr1" {
  name                = "Office1"
  redis_cache_name    = "${azurerm_redis_cache.redis.name}"
  resource_group_name = "${azurerm_resource_group.compute-group.name}"
  start_ip            = "${var.office_ip1}"
  end_ip              = "${var.office_ip1}"
}

resource "azurerm_redis_firewall_rule" "redis-fwr2" {
  name                = "Office2"
  redis_cache_name    = "${azurerm_redis_cache.redis.name}"
  resource_group_name = "${azurerm_resource_group.compute-group.name}"
  start_ip            = "${var.office_ip2}"
  end_ip              = "${var.office_ip2}"
}

resource "azurerm_redis_firewall_rule" "redis-fwr3" {
  name                = "APICloudService"
  redis_cache_name    = "${azurerm_redis_cache.redis.name}"
  resource_group_name = "${azurerm_resource_group.compute-group.name}"
  start_ip            = "${var.api_cloud_service_ip}"
  end_ip              = "${var.api_cloud_service_ip}"
}

Debug Output

Crash Output

Expected Behavior

Firewall rules are applied successfully

Actual Behavior

1 of 3 firewall rules were applied and an error returned for the other 2. Running terraform apply a second time resulted in the other 2 firewall rules being applied successfully.

Error message when running the first apply:


2 error(s) occurred:

* module.devrg.azurerm_redis_firewall_rule.redis-fwr1: 1 error(s) occurred:

* azurerm_redis_firewall_rule.redis-fwr1: redis.FirewallRulesClient#Get: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="A requested resource could not be found. It may already have been deleted.\r\nRequestID=a9fa0ea4-cb49-4af0-9009-779ebb720290"
* module.devrg.azurerm_redis_firewall_rule.redis-fwr3: 1 error(s) occurred:

* azurerm_redis_firewall_rule.redis-fwr3: redis.FirewallRulesClient#Get: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="A requested resource could not be found. It may already have been deleted.\r\nRequestID=7b49ccd8-e78c-43a8-8117-b499a72cdef0"

Steps to Reproduce

  1. Add multiple firewall rules to a redis cache definition within terraform and apply.
    This may not happen everytime, but I've reproduced it several times when trying to apply 3 firewal rules.

Additional Context

References

@ghost
Copy link
Author

ghost commented Jul 27, 2019

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 and limited conversation to collaborators Jul 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants