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

Refreshing the state of azurerm_redis_cache resource #13896

Closed
horsey opened this issue Apr 24, 2017 · 3 comments · Fixed by #13899
Closed

Refreshing the state of azurerm_redis_cache resource #13896

horsey opened this issue Apr 24, 2017 · 3 comments · Fixed by #13899

Comments

@horsey
Copy link

horsey commented Apr 24, 2017

Terraform Version

Terraform v0.9.2

Affected Resource(s)

azurerm_redis_cache

Terraform Configuration Files

resource "azurerm_redis_cache" "redis" {
    name                = "redis0"
    location            = "East US"
    resource_group_name = "${azurerm_resource_group.production.name}"
    capacity            = 1
    family              = "C"
    sku_name            = "Standard"
    enable_non_ssl_port = false

    redis_configuration {
        maxclients = "1000"
    }
    tags {
        role = "redis"
        environment = "production"
    }

 }

Debug Output

https://gist.github.com/horsey/d135a0646e6d4cd1bcbe1355092f19ee

Panic Output

None

Expected Behavior

redis0 resource should be re-created when converged with terraform apply.

Actual Behavior

terraform apply throws an error linked in the gist above.

Steps to Reproduce

  1. Converge the azurerm_redis_cache resource mentioned above
  2. terraform apply
  3. Delete the resource from the Azure portal manually.
  4. terraform apply

Important Factoids

The set of steps done on a azurerm_virtual_machine resource recreates the virtual machine. Is it okay to expect the similar behaviour?

References

None.

@horsey
Copy link
Author

horsey commented Apr 24, 2017

@tombuildsstuff I am not very sure if this is bug or an issue, but how do I get out of the situation I put my self in? I need to re-create the resource.

@tombuildsstuff
Copy link
Contributor

Hi @horsey

Thanks for raising this issue.

I am not very sure if this is bug or an issue, but how do I get out of the situation I put my self in? I need to re-create the resource.

Apologies about this - that's a bug, and I've opened PR #13899 to fix this issue.

In the interim you can force a recreation of the resource via the taint command on the next Plan/Apply, like so:

terraform taint azurerm_redis_cache.redis

If that doesn't work (seeing as it's been deleted manually anyway) - you can manually delete it via the state rm command:

terraform state rm azurerm_redis_cache.redis

Hopefully that should allow you to proceed until #13899 is merged? :)

Thanks!

@ghost
Copy link

ghost commented Apr 13, 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 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.

@ghost ghost locked and limited conversation to collaborators Apr 13, 2020
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