Change ami of an existing instance without destroy it

Author: medusaalbCreated Jan 5, 2023Updated Sep 28, 2026
Labelsenhancementservice/ec2stale

Description

Hi, I'm trying to change a ami from a existing instance. I have imported the instance. When execute terraform plan always appear 1 add and 1 destroy. i'd would like to keep the same instance i even used lifecycle { ignore_changes = [ami] } but the plan simply ignore the change and does not apply it How can i keep the same instance changing de ami without destroy? i'm using terraform 1.3.6 thanks in advance

References

No response

Would you like to implement a fix?

None

Source: hashicorp/terraform-provider-aws