Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Succeed creating aws_volume_attachment if identical attachment exists (…
…hashicorp#11060) If an `aws_volume_attachment` is identical to one that already exists in the API, don't attempt to re-create it (which fails), simply act as though the creation command had already been run and continue. This allows Terraform to cleanly recover from a situation where a volume attachment action hangs indefinitely, possibly due to a bad instance state, requiring manual intervention such as an instance reboot. In such a situation, Terraform believes the attachment has failed, when in fact it succeeded after the timeout had expired. On the subsequent retry run, attempting to re-create the attachment will fail outright, due to the AttachVolume API call being non-idempotent. This patch implements the idempotency client-side by matching the (name, vID, iID) tuple. Note that volume attachments are not assigned an ID by the API.
- Loading branch information