-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[Enhancement]: Do no retry on InsufficientInstanceCapacity
error when using aws_ec2_instance_state
#37730
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Here are two examples of the current behaviour:
|
Potential solution might be adding another case in func (p *servicePackage) CustomizeConn(ctx context.Context, conn *ec2_sdkv1.EC2) (*ec2_sdkv1.EC2, error) {
conn.Handlers.Retry.PushBack(func(r *request_sdkv1.Request) {
switch err := r.Error; r.Operation.Name {
case "RunInstances":
// `InsufficientInstanceCapacity` error has status code 500 and AWS SDK try retry this error by default.
if tfawserr_sdkv1.ErrCodeEquals(err, errCodeInsufficientInstanceCapacity) {
r.Retryable = aws_sdkv1.Bool(false)
}
// potential actions called in ec2_instance_state.go which may hit InsufficientInstanceCapacity
case "StartInstances":
// `InsufficientInstanceCapacity` error has status code 500 and AWS SDK try retry this error by default.
if tfawserr_sdkv1.ErrCodeEquals(err, errCodeInsufficientInstanceCapacity) {
r.Retryable = aws_sdkv1.Bool(false)
}
}
})
return conn, nil
}``` |
Should be solved by #37142 |
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. |
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. |
Description
Current:
When using the
aws_ec2_instance_state
to start an existingaws_ìnstance
, if there is no underlying capacity available for that instance type in the Availability Zone (InsufficientInstanceCapacity
), it will retry until:a) capacity becomes available - can be any amount of time between 1-50 minutes
b) it hits the default timeout of roughly 50 minutes
Proposed:
aws_ec2_instance_state
should behave likeaws_instance
when starting the instance, and error out if there is no capacity in the AZ, just like #21293 implemented.This makes the Terraform run much more uniform by failing immediately
Affected Resource(s) and/or Data Source(s)
Potential Terraform Configuration
References
AWS Terraform resources:
Related:
#21293
Would you like to implement a fix?
No
The text was updated successfully, but these errors were encountered: