4

If an instance is configured for IMDSv2 then after upgrading AWS-CLI we are able to connect to IMDSv2 , but we can not connect to it from java code.

Also, we could not find any documentation regarding whether we need any specific version of AWS java SDK to support IMDSv2, OR is it supported implicitly, OR is it not supported from JAVA SDK yet.

One more point is , how to ask default provider chain to use IMDSv2 while trying to load credentials.

Please let me know

Adi Dembak
  • 2,433
  • 2
  • 18
  • 26
Alok Bhandari
  • 41
  • 1
  • 3

1 Answers1

3

Support for IMDSv2 was added in:

  • 1.11.678 of aws-java-sdk (commit 06a2180e)
  • 2.10.20 of aws-java-sdk-v2 (commit 53451414)

I believe the default chain for both versions of the SDK will attempt IMDSv2, but have not verified that.

Jim Browne
  • 121
  • 3
  • 1
    Thanks, Jim. I have verified and it is working with version > 1.11.678. I have tried with two versions 1.16.678 and 1.12.159. – Abhishek Feb 19 '22 at 18:12