Closed patrickbcullen closed 9 years ago
Credentials should be loaded during construction. You should not need to forcibly call #refresh!
on newly created instance profile credentials. That said, while digging into the issue, I found a possible related issue that could cause your problems.
The bug caused instance profile credentials to not refresh if the expiration date was nil
. This could happen under a few scenarios where the initial load of credentials fails because the instance metadata service is not responding yet, for example. The related fix treats a nil
expiration as stale and accessing any of its attributes will force a refresh.
The fix is available in the released SDK and this should be resolved. Please re-open if the issue persists.
I was trying to use the Aws::InstanceProfileCredentials and kept getting an error that the credentials were not set. I finally figure out the solution, call the refresh! method before trying to use the credentials.
It would be more intuitive if the InstanceProfileCredentials called the refresh method in its constructor.