Issue
I am using Terraform to manage my EC2 instances in AWS. I want to understand which changes in the EC2 configuration would require the instance to be recreated rather than just updated in-place.
For example, I know that changing the instance type or AMI ID would require the instance to be recreated. However, I am not sure about other configuration options.
Could someone please provide a comprehensive list of changes that would necessitate an EC2 instance to be recreated when using Terraform? This would help me better plan my infrastructure updates and minimize any potential downtime.
Thank you!
I was expecting the instance type and AMI ID changes to require instance recreation, based on my prior knowledge and the official Terraform documentation. However, I'm unsure about other configuration options, such as changes to security groups, network interfaces, and EBS volume attachments. I would like to know if these changes also trigger instance recreation or if there are other scenarios where an instance would need to be recreated.
My goal is to get a comprehensive understanding of the changes that necessitate an EC2 instance to be recreated in Terraform, so I can plan my infrastructure updates accordingly and minimize any potential downtime.
Solution
In order to find that out, you would need to go through the documentation, parameter by parameter. What I find useful in that case is using the CloudFormation documentation, because underneath a parameter you get an information such as:
Update requires: Some interruptions
For instance, the documentation says the following for changing the security group:
Update requires: Replacement
For any other parameters that you mentioned, you can check the documentation.
Answered By - Marko E Answer Checked By - Cary Denson (WPSolving Admin)