-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
[Bug]: ReservationCapacityExceeded error when changing capacity reservation id and instance_type of aws_instance #32458
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
This functionality has been released in v5.37.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. |
Terraform Core Version
1.5.2
AWS Provider Version
5.7.0
Affected Resource(s)
Expected Behavior
Instance should have new instance_type and capacity reservation ID
Actual Behavior
Instance was stopped, instance_type updated, then instance failed to start because of reservation capacity type and instance type mismatch.
I can see that instance type update is not linked to capacity reservation change, and happens earlier:
https://github.com/hashicorp/terraform-provider-aws/blob/v5.7.0/internal/service/ec2/ec2_instance.go#L1662
https://github.com/hashicorp/terraform-provider-aws/blob/v5.7.0/internal/service/ec2/ec2_instance.go#L1936
That explains the behaviour. I suppose when aws_instance has instance_type and capacity reservation ID changes, the provider should perform the changes in stop/start context. I'm willing to implement the fix, but please advise on proper behaviour here.
Relevant Error/Panic Output Snippet
Error: updating EC2 Instance (i-0db1177c4c05dc826) type: starting EC2 Instance (i-0db1177c4c05dc826): ReservationCapacityExceeded: The requested reservation does not have sufficient compatible and available capacity for this request. status code: 400, request id: 21debb5c-604d-4c37-85d5-9cc4ff1cfd30
Terraform Configuration Files
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
Yes
The text was updated successfully, but these errors were encountered: