Fixes #2188
This update introduces the ignore_destroy attribute to the Kubernetes provider. When set to true, it ensures that the resource will only be applied and will not be deleted during a Terraform destroy operation.
Important Note:
The ignore_destroy attribute only takes effect if the resource is applied with the attribute set to true prior to running a destroy operation. If the attribute is set immediately before the destroy command, it will not have any impact. This limitation arises because, at destroy time, the provider does not have access to the resource's configuration, as nothing is being created. As such, the attribute must be applied during the resource creation phase for it to take effect during subsequent destroy operations.
I believe this sort of edge case should be considered when using the ignore_destroyattribute, and I will need document the process accordingly in the provider documentation.
Acceptance tests
[ ] Have you added an acceptance test for the functionality being added?
[x] Tested using a test config on my local machine. When running apply with the attribute set, following terraform destroy. the resource is not deleted, but when adding the attribute after the resource is created, the resource is destroyed.
[ ] Have you run the acceptance tests on this branch?
Description
Fixes #2188 This update introduces the
ignore_destroy
attribute to the Kubernetes provider. When set totrue
, it ensures that the resource will only be applied and will not be deleted during a Terraform destroy operation.Important Note: The
ignore_destroy
attribute only takes effect if the resource is applied with the attribute set to true prior to running a destroy operation. If the attribute is set immediately before the destroy command, it will not have any impact. This limitation arises because, at destroy time, the provider does not have access to the resource's configuration, as nothing is being created. As such, the attribute must be applied during the resource creation phase for it to take effect during subsequent destroy operations.I believe this sort of edge case should be considered when using the
ignore_destroy
attribute, and I will need document the process accordingly in the provider documentation.Acceptance tests
terraform destroy
. the resource is not deleted, but when adding the attribute after the resource is created, the resource is destroyed.Output from acceptance testing:
Release Note
Release note for CHANGELOG:
References
Community Note