Core: Add hint for resource conflict errors (EntityAlreadyExists)#38038
Core: Add hint for resource conflict errors (EntityAlreadyExists)#38038KyungHwanKim-devs wants to merge 3 commits intohashicorp:mainfrom
Conversation
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Gemini Agent seems not to be a GitHub user. Have you signed the CLA already but the status is still pending? Recheck it. |
Some provider errors indicate that a resource already exists during a replacement. This commonly happens when a resource is renamed or moved without a moved block; Terraform sees the old and new addresses as distinct and may attempt the create before the old object is fully gone. Add a diagnostic hint for explicit already exists signals to recommend moved blocks or terraform state mv. Refs hashicorp#24704 Signed-off-by: KyungHwanKim-devs <kkhdevs@gmail.com>
Signed-off-by: KyungHwanKim-devs <kkhdevs@gmail.com>
Signed-off-by: KyungHwanKim-devs <kkhdevs@gmail.com>
68f2f74 to
d37a30e
Compare
|
Hi @radeksimko , CI checks are passing and CLA is signed. Could someone from the team review this when you have a chance? Happy to address any feedback. Thanks! |
|
Hi @KyungHwanKim-devs, this PR looks OK to review, the one comment from triage was:
I will raise this again in triage to see if we can prioritize reviewing this submission. Thanks! |
|
Hi @KyungHwanKim-devs, the feedback from triage is that this error covers one possibility that could cause this error, but may be misleading to users for other ways in which this error could be triggered. So this could be helpful for the right user, but send other users with this issue down the wrong track. For that reason, we are going to decline accepting this PR. Feel free to follow up if you believe there is a better way to target this hint. |
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