-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
enhancementNew feature or requestNew feature or request
Description
SDK version
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.1
Use-cases
I want to run testcases on resources that are already created.
An example is import a resource that always exists and check whether the existing plan has a diff compared to the imported resource.
Attempted Solutions
I have tried to run tests but there is no option to prevent a destroy of the resource after all steps are completed
Proposal
Add an option SkipPostTestDestroy that prevents destory of resources in the state after all steps are complete
By default this option is false to ensure backward compatibility
To be added here https://github.com/hashicorp/terraform-plugin-sdk/blob/v2.38.1/helper/resource/testing_new.go#L78
I assume SkipPostTestDestroy is not present to avoid keeping lingering resources
In certain cases, we will need this option
References
https://github.com/hashicorp/terraform-plugin-sdk/blob/v2.38.1/helper/resource/testing.go#L308
https://github.com/hashicorp/terraform-plugin-sdk/blob/v2.38.1/helper/resource/testing_new.go#L78
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request