Long story short, it's Amazon — there are way too many ways to set credentials.
Though my preferred method is not the recommended way, I find that it plays well with setting other environment-based values for your application. That is by using environment variables.
The AWS SDK automatically looks for your credentials in environment variables. You can set the following values:
Then it'll just work, like magic!
A big benefit to this approach is that you can have multiple projects on your machine and set these values contextually based on the project you're working with.
Want to receive approximately one email every month with new articles, tools, and references I've discovered? Sign up below.