Skip to content

[Draft] feat: add support for accountId in imds #1621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

smilkuri
Copy link
Contributor

@smilkuri smilkuri commented Jun 16, 2025

Issue #, if available:
Internal JS-5966

Description of changes:

This PR adds support for version 2.1 of the IMDS credentials provider. With this update, the provider can now retrieve credentials that include an account ID.

To support this functionality, the credentials provider first attempts to access the extended API endpoint, which ends with -extended. If this endpoint returns a 404, the provider falls back to the legacy API endpoint—the same one used in the IMDS credentials provider v2.0.

This "try extended API, then fall back to legacy API" pattern is applied to both retrieving the IMDS instance profile name and fetching credentials.
Only the extended API can return credentials that include an account ID.

The PR also made the following IMDS credentials providers options configurable:

  • Disable IMDS credentials fetching
  • IMDS instance profile name

Both options can be configured via environment variables or a shared config file, with environment variables taking precedence over the config file.

ToDo:

  • Add additional testcases for unstable profile and fallback to legacy
  • Add support for feature Id tracking

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant