Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raytung
Copy link

@raytung raytung commented Mar 9, 2023

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
Collaborator

@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
Copy link
Author

raytung commented Mar 31, 2023

@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

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
Copy link
Author

raytung commented Oct 24, 2023

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