EC2 在 Terraform 中需要重新创建实例的哪些更改?

huangapple go评论68阅读模式
英文:

What changes in EC2 require instance recreation in Terraform?

问题

我正在使用Terraform来管理我的AWS中的EC2实例。我想了解在EC2配置中哪些更改需要重新创建实例,而不仅仅是在原地更新。

例如,我知道更改实例类型或AMI ID将需要重新创建实例。但是,我不确定其他配置选项。

请问有人能提供一个详尽的更改清单,这些更改将需要在使用Terraform时重新创建EC2实例吗?这将有助于我更好地规划我的基础设施更新并减少潜在的停机时间。

谢谢!

根据我的先前知识和官方的Terraform文档,我原本期望更改实例类型和AMI ID会需要重新创建实例。然而,我不确定其他配置选项,比如更改安全组、网络接口和EBS卷附加是否也会触发实例重新创建,或者是否还有其他需要重新创建实例的情景。

我的目标是全面了解在Terraform中需要重新创建EC2实例的更改,以便我可以相应地规划我的基础设施更新并最小化潜在的停机时间。

英文:

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.

答案1

得分: 1

要找出这个信息,您需要逐个查阅文档中的参数。在这种情况下,我发现使用CloudFormation文档很有用,因为在参数下面,您会得到以下信息:

更新需要: 一些中断

例如,文档对于更改安全组的操作如下:

更新需要: 替换

至于您提到的其他参数,请查看文档

英文:

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.

huangapple
  • 本文由 发表于 2023年7月24日 15:26:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/76752238.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定