Skip to content

fix(index, saved_searches): Refreshing Terraform state if resources are deleted outside of Terraform#151

Open
raytung wants to merge 1 commit into
splunk:masterfrom
raytung:fix/allow-update-modified
Open

fix(index, saved_searches): Refreshing Terraform state if resources are deleted outside of Terraform#151
raytung wants to merge 1 commit into
splunk:masterfrom
raytung:fix/allow-update-modified

Conversation

@raytung

@raytung raytung commented Mar 9, 2023

Copy link
Copy Markdown

Hey team,

This PR fixes a problem with the index and saved_searches resource if someone deleted them outside of Terraform. Instead of erroring out on Terraform plan / apply, it should recreate these resources.

…re deleted outside of Terraform

Instead of erroring out on Terraform plan / apply
@raytung raytung changed the title fix(index, saved_searches): Refreshing Terraform state if resources a… fix(index, saved_searches): Refreshing Terraform state if resources are deleted outside of Terraform Mar 9, 2023
@raytung raytung marked this pull request as ready for review March 9, 2023 10:25
@anushjay

Copy link
Copy Markdown
Contributor

@raytung I don't think this scenario, which is caused by managing resources manually, should be handled within the provider. Can you not use the terraform rm state cmd to remove the resource from the tf config?

@raytung

raytung commented Mar 31, 2023

Copy link
Copy Markdown
Author

@anushjay In the ideal case, resources managed by Terraform shouldn't be managed manually, but in reality it's difficult to make that guarantee, especially in a tool like Splunk where it has a big exploratory component. In some cases, we need to allow Terraform to reconcile the state without having to manually running resource removal from Terraform states.

This problem is also mentioned in another issue #86

@jeffsanicola

Copy link
Copy Markdown

This would greatly help in my situation. We have a centralized Terraform deployment process where state files are supported by a different team. Every time I run into an issue like this I need to open a case with our support team to have the element removed from state. Enabling such drift detection would eliminate the need for me to open cases while developing modules that leverage this provider.

@raytung

raytung commented Oct 24, 2023

Copy link
Copy Markdown
Author

Hey @anushjay, would love to get your second thoughts on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants