Core: Add hint for resource conflict errors (EntityAlreadyExists) #38038
+129
−0
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.
Refs #24704
Summary
already exists/EntityAlreadyExistsso unrelatedduplicateerrors do not get a misleading hint.movedblocks during refactors and provider-side asynchronous deletes/eventual consistency.Rationale / Background
This issue has two recurring causes:
movedblocks, Terraform plans a destroy+create and may attempt the create before the old object is fully gone.already existserrors on replacement.The hint should steer users toward the correct fix without over-triggering on unrelated errors. This change keeps the hint but narrows the match to explicit
already existssignals and clarifies the two likely root causes in the message.User-facing Behavior
No behavior change to planning or apply execution. A warning hint is appended only when an error explicitly indicates the object already exists.
Testing
go test ./internal/terraform -run TestHintIfAlreadyExistsTarget Release
1.15.x
Rollback Plan
Changes to Security Controls
No. This only adjusts diagnostic messaging.
CHANGELOG entry