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

Remove TLS subscriptions that 404 from state #479

Merged
merged 2 commits into from
Oct 15, 2021

Conversation

bendrucker
Copy link
Contributor

When a TLS subscription is removed outside of Terraform, currently it causes refreshes to fail

╷
│ Error: 404 - Not Found:
│ 
│     Title:  Not found
│     Detail: The subscription you requested was not found

Instead, the provider should remove these resources from state. This is handled in other resources but the exact implementation differs a bit by resource.

Copy link
Contributor

@smaeda-ks smaeda-ks left a comment

Choose a reason for hiding this comment

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

Hi @bendrucker, thanks for the PR.

tls_subscription_validation is a virtual resource so I don't think it's worth adding this logic in there. Could you please undo that?

@smaeda-ks smaeda-ks added the enhancement New feature or request label Oct 3, 2021
@bendrucker
Copy link
Contributor Author

Hey @smaeda-ks I thought it might still help address the following scenario:

  1. I apply configuration that creates a tls_subscription and uses the validation resource to wait for completion
  2. I delete the TLS subscription outside of Terraform
  3. I re-apply the configuration

The result should be the same after steps 1 and 3. Without this logic in the validation resource, I expect the same error would occur on refresh during step 3, requiring state rm to proceed.

@smaeda-ks
Copy link
Contributor

ok, thanks. I'll give it a try and get back to you.

Copy link
Contributor

@smaeda-ks smaeda-ks left a comment

Choose a reason for hiding this comment

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

Added a commit to change the way to return the warning message (and removed nesting).

@smaeda-ks smaeda-ks merged commit 41cf812 into fastly:main Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants