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: resources deleted outside Terraform not re-created #149

Merged
merged 3 commits into from
Dec 4, 2023

Conversation

joaomper-TE
Copy link
Contributor

Fixes #112.

Problem was that when attempting to read the resource, we were not handling the 404 properly. Now, we set the ID to null so that terraform understands that the resource no longer exists and tries to recreate it.

Tested locally and now, after the resource is deleted manually in the UI, a terraform plan attempts to re-create it.

remote, err := readFunc(client, id)

// Check if the resource no longer exists
if err != nil && IsNotFoundError(err) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the fix.

@joaomper-TE joaomper-TE requested review from pedro-te and a team November 30, 2023 16:52
@joaomper-TE joaomper-TE changed the title Fix problem with resources deleted outside Terraform. bug: Fix resources deleted outside Terraform. Nov 30, 2023
@joaomper-TE joaomper-TE changed the title bug: Fix resources deleted outside Terraform. fix: resources deleted outside Terraform not re-created Nov 30, 2023
shahid-te
shahid-te previously approved these changes Nov 30, 2023
pedro-te
pedro-te previously approved these changes Nov 30, 2023
@joaomper-TE joaomper-TE force-pushed the bug-fix-read-operations branch from 598bd1a to f8f1a2f Compare November 30, 2023 17:38
@joaomper-TE joaomper-TE merged commit 209f933 into thousandeyes:main Dec 4, 2023
@joaomper-TE joaomper-TE deleted the bug-fix-read-operations branch December 4, 2023 09:20
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.

404 Not Found error if the test is deleted from the gui
4 participants