-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
adds resource retry to SpotInstanceRequestCreate #8516
adds resource retry to SpotInstanceRequestCreate #8516
Conversation
so that the create process waits for IAM Instance profiles and roles to propagate before continuing, this has been taken from `resource_aws_instance`
return resource.RetryableError(err) | ||
} | ||
// IAM roles can also take time to propagate in AWS: | ||
if isAWSErr(err, "InvalidParameterValue", " has no associated IAM Roles") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep this simple here, since you are not doing anything special with the InvalidParameterValue
specific message, besides logging, that is. You could simply check for it, then log a message that there was an error, and use err.Message()
(need to assert right type, though) and then return resource.RetryableError(err)
as usual.
Hello @kwilczynski, not sure I understand what you mean ? my reasoning for this is that the code should retry on the two specific error messages of "has no associated IAM Roles" and "Invalid IAM Instance Profile" with any other error that could occur would not be retried. To Keep things consistent with other parts of the code base, this was copied from the aws_instance resource. |
@richardbowden fair enough, given that the original implementation does this too. I wish AWS reported certain errors differently. Sorry! |
this LGTM! The tests are green:
Thanks so much for all the work here :) Paul |
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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Fixes #8426
so that the create process waits for IAM Instance profiles and roles to propagate before continuing, this has been taken from
resource_aws_instance