-
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
helper: Add ContinuousTargetOccurence to work around inconsistency #4447
helper: Add ContinuousTargetOccurence to work around inconsistency #4447
Conversation
This would help us to unblock the KMS PR (or at least it is my feeling that people will less likely complain about the eventual consistency effects of it). @catsby @phinze What do you think of this concept? I know it may look a bit "hacky", but I was not able to come up with anything better. Vault apparently somehow worked around this by using STS (which is region specific), but that's not quite the option for us in Terraform I'm afraid as we're working with the resources directly, not solving auth problem. |
14de606
to
b36ca45
Compare
b36ca45
to
a490983
Compare
Just finally got around to looking at this. Seems like a totally reasonable thing for us to add, and I like the unit tests! LGTM |
ok, I will resolve the conflicts, repush and wait for green light from Travis, then merge |
a490983
to
2127e9c
Compare
2127e9c
to
ab73f2b
Compare
helper: Add ContinuousTargetOccurence to work around inconsistency
It looks like this was merged in almost three years ago, but still seeing people reporting issues with IAM resource creation and eventual consistency. Is there some (possibly unknown) config/flag one needs to use to indicate, "this is an eventually consistent resource, wait until you have x consistent successful gets before moving on"? |
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. |
This is to work around the known issue with inconsistent APIs, like IAM or KMS, namely #4375 #4306 #2869 #2499 #2136
Very similar issue has been raised recently in Vault too: hashicorp/vault#687
cc @jefferai
As you may expect such issues are difficult to reproduce unless you have a full copy of AWS environment.
Current solution(s)/work-around(s)
Just simply wait for the 1st "successful" state
The problem here is that 1st success != replication done, see below a snippet from my KMS testing:
Retry dependent API calls
This for example means retrying
ec2:StartInstance
if the IAM Instance Profile has a policy which has not been replicated yet or retryingecs:CreateService
if the IAM Role has a policy which has not been replicated yet.It seemed to be a pretty good solution, until I realised this approach fails exactly the same way as the approach above - see #4375 (comment) where
ecs:CreateService
succeeded and subsequentecs:UpdateService
failed.