-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS EC2 instance public IP address is not updated on instance type change #20651
Comments
Can confirm same behavior on t3 instance types. In the case of a route53 update, you can quiesce by running the apply 2x and the ip address will get updated on the A record. |
Facing the same issue on every operation that requires instance shutdown. For example, updating the user metadata. The instance is updated but TF doesn't care about the changed IP address so any code that is relying on it will fail or produce broken infrastructure. Why this severe bug is not being fixed? |
Jumping on the bandwagon here, can confirm this is still the behavior under terraform 1.2.6 with aws provider 4.27.0. |
I still got this issue. May I know how to fix it? |
In many cases, a workaround is to run the apply again, which will see the updated IP and update dependent resources/outputs/etc. |
+1 using cf provider for dns |
This issue seems to be a duplicate of #6781. |
The workaround using an intermediate |
Still affected by this bug 3 years after it was reported. |
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v5.83.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
I have the following piece of the configuration:
The idea here is that the record must have the instance's public IP address. And it worked well. Then I changed the instance type to
t2.nano
and Terraform has created the following plan:You may see here that TF has changed the instance instead of replacing it. In the reality, the instance is replaced and gets a new public IP address. But this change is not reflected in the plan and after executing, the infrastructure becomes broken because the DNS record remains to have an old invalid IP address.
Terraform Version
1.0.3 Docker
Expected Behavior
EC2 instance is replaced in TF state.
Route 53 record is updated with the new instance's IP address.
Actual Behavior
EC2 instance is not replaced in TF state.
Route 53 record is not updated with the new instance's IP address.
The text was updated successfully, but these errors were encountered: