As can be seen in this question, the Java SDK has a method to retrieve the current user based on the request's credentials. Is there a way to do something similar using the Ruby SDK?
I've tried AWS::IAM.new(creds).access_keys[creds[:access_key_id]], but that returns a simple object that answers nil to user or user_name, and my user doesn't have the iam:ListUsers permission so I can't enumerate the users collection.
Basically I need that information because I want to generate a self-approving policy to be attached to some new resources, and I need to fetch the ARN that my configured access key is associated with. Any suggestions?
Aucun commentaire:
Enregistrer un commentaire