Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use IMDSv2 for all metadata service calls.
Problem: We did not attach the token to IMDS calls, resulting in IMDSv1 being used. The SDK does support using tokens but only for calls to the endpoint `/latest/meta-data/iam/security-credentials/`. https://github.com/aws/aws-sdk-js/blob/3333f8b49283f5bbff823ab8a8469acedb7fe3d5/lib/metadata_service.js#L123-L235 Solution: Call the "private" sdk method to get the token so code isn't duplicated, and attach that in the header of our calls just like the sdk does for the above endpoint. AWS SDK v3 does not support token handling aws/aws-sdk-js-v3#4004
- Loading branch information