Isn't there any way where we don't provide any credentials and during
actual calls blob fetches the credentials (via EC2 token internally)
just like the original AWS (AmazonS3ClientBuilder) client uses.

As far as I am aware, this is not currently possible, no. https://github.com/jclouds/legacy-jclouds/issues/1280 seems like a feature request for this, but it was not implemented.

What the AWS libraries are doing, as you point out, is fetching the token internally before making any calls. The Stack Overflow example demonstrates how one can do this using jclouds, but using STS.

For the instance profile, I think what would be needed is something like:

1) Get an instance of the the instance profile API (this is in jclouds-labs-aws)
2) Use this instance to pull credentials from the machine when needed
3) Pass the credentials retrieved in 2) to jclouds via a Supplier<Credentials>

I haven't tried this myself, though - hopefully someone on this thread is able to provide a code example, or other ways in which this can (or cannot) be made to work!

Regards

ap

Reply via email to