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

Must specify userName when calling with non-User credentials #17

Closed
llange opened this Issue Mar 29, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@llange
Copy link
Contributor

llange commented Mar 29, 2016

On some resources I have this error on update / delete.

I'm sure that it happens for policies - maybe some others but I have no example right now.

It seems to come from https://github.com/winebarrel/miam/blob/v0.2.4/lib/miam/driver.rb#L410 (for updates) where it tries to construct the ARN for the policy.

The ARN is constructed here https://github.com/winebarrel/miam/blob/v0.2.4/lib/miam/driver.rb#L463 with the user name.
(However, the ARN for a policy has no user name in it - but the account ID)

When it tries to fetch the current user, it fails - and then cannot construct the request.

However I'm pretty sure the resulting ARN won't identify the policy as it needs the account ID.

llange added a commit to llange/miam that referenced this issue Mar 29, 2016

Tentative fix for issue codenize-tools#17
This rewrites the policy_arn to use account_id instead of user_id.
I did not find a clean way to identify account_id 100% of time
without this ugly hack. (Esp. when using IAM identities +
switch roles).
I'd be interested in a clean way to do that.

winebarrel pushed a commit that referenced this issue Mar 31, 2016

Genki Sugawara
@yayugu

This comment has been minimized.

Copy link

yayugu commented Aug 30, 2016

STS GetCallerIdentity is better API to get account ID.
http://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html

gree/subiam@9dc9087

llange pushed a commit to llange/miam that referenced this issue Jan 17, 2017

@llange

This comment has been minimized.

Copy link
Contributor Author

llange commented Jan 17, 2017

@yayugu 's patch works fine.

Please merge it - you can merge it from my branch llange/miam@443550c if easier.

winebarrel pushed a commit that referenced this issue Jan 17, 2017

Genki Sugawara
@winebarrel

This comment has been minimized.

Copy link
Collaborator

winebarrel commented Jan 17, 2017

@llange I am sorry for the late reply. 🙇
I merged your commit and released v0.2.4.beta9.

@yayugu Thanks for your comment.

@llange

This comment has been minimized.

Copy link
Contributor Author

llange commented Jan 10, 2019

I'm so late, sorry, but after near one year I'm closing this issue. Thanks !

@llange llange closed this Jan 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment