-
Notifications
You must be signed in to change notification settings - Fork 132
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
RolePolicyAttachment.iam is detaching policies every reconciliation #929
Comments
I think I've figured out why we're only seeing this issue with some resources. This regression was introduced by #745 which was released in provider version 0.40.0. That caused all of our Roles created after the provider 0.40.0 upgrade are late initializing an array of managed policies that is the result of a race between the Role managed resource and any RolePolicyAttachment managed resources that were created at the same time. Sometimes that has all the policies we want, and sometimes it's only a subset. It does appear to never be an empty array, probably thanks to some logic in late initalization. Thinking about how to mitigate this, I think that users will need to upgrade to a version of the provider that doesn't late initialize It also seems like we should at least consider whether this warrants releasing the fix as versions 0.40.1, 0.41.1 and/or 0.42.1 |
Open an PR for this: #933 |
In case anyone is running into issues and looking here for a fix, once you upgrade to provider version 0.43, any iam To get the
|
What happened?
Every time a
RolePolicyAttachment.iam.aws.upbound.io
resource that has apolicyArnSelector
is reconciled, the policy is detached and re-attached to the role. This results in IAM permissions being temporarily incorrect, causing unexpected errors and downtime for some applications.How can we reproduce it?
This happens for all of our resources using a selector similar to this:
If we do a
kubectl get rolepolicyattachments -w
we see that any resources doing this become unready every reconciliation loop, and the policies disappear from the resource in the AWS console or CLI. This last up to 30 seconds before being restored. Theprovider-aws-iam
pod with debug logs enabled show the creation event, but not whatever is causing it to become detached.What environment did it happen in?
The text was updated successfully, but these errors were encountered: