Return error if the vault secrets app resource is not found. #619
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🛠️ Description
The provider crashes when reading Vault Secrets App resources that no longer exist because the
Read
method of theresource_vault_secrets_app
does not currently return early on error. (I encountered this when doing aterraform destroy
with a resource that had already been manually deleted). This also appears to be a bug in theUpdate
method.🏗️ Acceptance tests
I looked into writing a test for this, but based on my understanding of the test harnesses, the terraform test helper
.Test
handles both theapply
and thedestroy
. To properly verify the patch, the resource needs to be removed out-of-band of the terraform runs (this could probably be done as a final step of theSteps
array, using theclient
, if I understand how the provider and test helpers are structured).I wanted to get feedback on whether this patch is worthwhile, as well as any input on how you'd like to see it tested, before I got into the weeds on it.