-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
What's the easiest way to create a session from AssumeRole response? #801
Comments
Hi @tleyden thanks for reaching out to us. This is a great place to ask questions, and contribute. With v1.3.0 the SDK now supports loading assume roles derived from the Shared Config files Assuming a role from the shared config is great if you have access to those files, or want to create a session from them. Alternatively if your use case needs the sessions to be created at runtime dynamically the SDK provides the The way a session will setup assume role from the shared config is a good example how to setup a stscreds.AssumeRoleProvider. |
Ok thanks! I think stscreds.AssumeRoleProvider is exactly what I was looking for. |
It's been more than 5 years, and the AWS golang SDK is still incomprehensible with regards to how to do this more natively. I stared at the stscreds.AssumeRoleProvider file for 20 minutes and still can't figure it out. |
Thanks very much, the above example helped me. For the benefit of others, I have used
The |
The example above worked for me when I also added |
Here's how I'm creating a session from an AssumeRole response:
The
NewAssumeRoleCredentialsProvider()
call is to create a customcredentials.Provider
that I had to create:Is there already the equivalent of
AssumeRoleCredentialsProvider
somewhere in the API that I can use? Or a less awkward way of doing this?Sorry if this isn't the best place to ask .. if not let me know where to ask questions like these.
The text was updated successfully, but these errors were encountered: