-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Expose IMDS Client Command #9266
Comments
To implement a feature that exposes a command for IMDS (Instance Metadata Service) requests in the AWS CLI and SDK for we can prefer this: 1. Update
|
Looks like an LLM-generated comment that's just taken the issue and fluffed it up with some trivial tasks and code snippets. The Smithy model is very incorrect and IMDSv1 support should not be considered as the AWS SDK IMDS clients should only support IMDSv2 as per the docs (IMDSv1 is deprecated). |
Describe the feature
Expose a command for IMDS requests (e.g.
aws imds get --path /latest/user-data
) which automatically handles IMDS session token fetching + caching.Use Case
Shell scripts are often used to set up EC2 instances manually (e.g. via SSH or SSM sessions) or automatically (e.g. EC2 user data scripts, CodeDeploy Agent hooks, SSM documents). They are also used for simple on-instance EC2 Auto Scaling lifecycle hook daemons (e.g. systemd service units).
These may need to fetch data from IMDS (e.g. user data, auto scaling target lifecycle state).
Today, this requires using
curl
to manually fetch IMDS session tokens for use in subsequent get requests.Proposed Solution
The AWS SDKs implement an IMDS client. This is used to support IMDS region + credentials providers.
Some AWS SDKs expose the IMDS client to let users make IMDS calls without having to worry about fetching + caching session tokens. For example:
The idea is to do the same for the AWS SDK for Python (boto) and the AWS CLI.
IMDSFetcher
or a similar class expose a general-purpose publicget()
method.get()
method.Other Information
No response
Acknowledgements
CLI version used
2.*
Environment details (OS name and version, etc.)
All
The text was updated successfully, but these errors were encountered: