You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❯ terraform version
Terraform v1.1.9
on windows_amd64
Your version of Terraform is out of date! The latest version
is 1.4.6. You can update by downloading from https://www.terraform.io/downloads.html
Use Cases
There are times when we have resources defined in Terraform, but we need to make manual adjustments to those resources outside of Terraform, and we want our manual changes to remain applied for a while.
If we ran Terraform Plan/Apply, it would pick up the differences and attempt to correct them.
If we removed the code from Terraform, the Plan/Apply would destroy the resources.
Neither of these are what we want. We simply want a way to still have the code defined in Terraform, with a way to signal Terraform to just completely ignore checking the resource for now.
One concrete example is when we want to turn off an Azure Virtual Machine (VM) for a while as a scream test before completely destroying it. The Azure RM Terraform provider does not provide a way to flag a VM as turned off, and if the VM is turned off, then Terraform Plan/Apply always fails because it cannot communicate with the resource.
Attempted Solutions
For the example above of turning off Azure VMs for a while before destroying them:
If we turn the VM off, then the Terraform Plan fails because it is not able to check the VM's state.
If we comment out or remove the code, then Terraform would destroy that VM.
If we use the prevent_destroy or ignore_changes flags, the Plan still fails because it is not able to check the CM's state.
Proposal
I would propose an ignore_checking_resource = true flag (use a different name if you like) that could be added to any resource, which signals to Terraform to not bother checking the resource and just assume it matches what it has in the state file. Even if the resource is deleted and does not exist, Terraform would not warn or error about it.
It would make sense to add this new attribute as part of the resource syntax, rather than a command-line parameter, as many Terraform flows are done via automated pipelines. It could also be included as a command-line parameter, but our main use case would be to have it in code.
References
I think this request is related to issues #23547, #3874, and #2253, but is different enough that it might not make sense to lump it in with them as a duplicate. I'll leave that decision to you fine folks.
The text was updated successfully, but these errors were encountered:
Thanks for the extra information. I assume what you mean here by "resource checking" is the refresh, or ReadResource call. If that's the case we can track the request in issue #32403
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.
Terraform Version
❯ terraform version Terraform v1.1.9 on windows_amd64 Your version of Terraform is out of date! The latest version is 1.4.6. You can update by downloading from https://www.terraform.io/downloads.html
Use Cases
There are times when we have resources defined in Terraform, but we need to make manual adjustments to those resources outside of Terraform, and we want our manual changes to remain applied for a while.
Neither of these are what we want. We simply want a way to still have the code defined in Terraform, with a way to signal Terraform to just completely ignore checking the resource for now.
One concrete example is when we want to turn off an Azure Virtual Machine (VM) for a while as a scream test before completely destroying it. The Azure RM Terraform provider does not provide a way to flag a VM as turned off, and if the VM is turned off, then Terraform Plan/Apply always fails because it cannot communicate with the resource.
Attempted Solutions
For the example above of turning off Azure VMs for a while before destroying them:
prevent_destroy
orignore_changes
flags, the Plan still fails because it is not able to check the CM's state.Proposal
I would propose an
ignore_checking_resource = true
flag (use a different name if you like) that could be added to any resource, which signals to Terraform to not bother checking the resource and just assume it matches what it has in the state file. Even if the resource is deleted and does not exist, Terraform would not warn or error about it.It would make sense to add this new attribute as part of the resource syntax, rather than a command-line parameter, as many Terraform flows are done via automated pipelines. It could also be included as a command-line parameter, but our main use case would be to have it in code.
References
I think this request is related to issues #23547, #3874, and #2253, but is different enough that it might not make sense to lump it in with them as a duplicate. I'll leave that decision to you fine folks.
The text was updated successfully, but these errors were encountered: