terraform test: override prevent_destroy meta attribute#37364
terraform test: override prevent_destroy meta attribute#37364liamcervante merged 2 commits intomainfrom
Conversation
|
This however prevents users from being able to test a module, where they also want to see the destroy prevented like in the real module. |
This is already impossible to test. Currently, the test will fail with an error during the cleanup stage if the prevent_destroy attribute is set to true, always leaving behind the resource in the underlying provider with no state file to help clean things up. I'm not sure how valuable is to let users test that anyway. If |
|
Some conflicts need to be resolved. |
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR allows
terraform testto override theprevent_destroyattributes during it's cleanup operations. Terraform test should always clean up any infrastructure it has created, and is basically unusable as long as prevent_destroy is set to true. We shouldn't ask users to update their configs to make the testing framework work.Fixes #34960
Target Release
1.14.x
Rollback Plan
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
CHANGELOG entry