I have an issue that I cannot explain and I am pretty sure that things used to work.
I have an aws_instance
resource. When updating the AMI, it gets replaced. But instead of destroying the previous instance and creating the new one, it creates the new instance and leave the “destroy” for the end.
This causes issues with EBS volume attachments that did not happen a couple of minor versions before. When the instance that is meant to be destroyed is destroyed first, the attachment (skip_destroy=true) is gone with it, and it can be re-attached to the new instance afterwards.
Funny enough, I have a second, similar type of instance in the same stack that behaves as I expect and gets destroyed before created.
In all of this there is no create_before_destroy
life-cycle directive involved.
Any tips?