-
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
provider/aws: Retry RunInstance if IAM profile hasn't propagated #2037
Conversation
LGTM! 👍 |
👍 |
provider/aws: Retry RunInstance if IAM profile hasn't propagated
I think we're seeing a problem related to this. Every now and then we'll get an instance that comes online which has the proper IAM role assigned to it (by name), but it appears to be the ID of the old role. The consequence is that the instance in our case cannot For the record, we use |
@osterman That's definitely odd! Sounds like it must be upstream misbehavior - the API accepts "name" here so I'm not sure if there's much else we can do on our side? Perhaps something to take up with AWS Support. If you believe there are steps we should be taking on the Terraform side, feel free to file us a fresh issue! |
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. |
Newly created IAM roles can take a few seconds to propagate.
From Launching an Instance with an IAM Role Using the AWS CLI:
In testing, this time is typically 5-10 seconds. In this PR, add a simple
for
loop that tries up to 5 times, sleeping 2 seconds in-between, if and only if we hit an error that matches that kind of failure.Fixes #1885