readimds-0.1.4 is not a library.
readimds
Small CLI for AWS EC2 IMDSv2 (Instance Metadata Service). Run on an EC2 instance to read instance metadata and instance tags without shelling out to curl.
Install
Usage
| Subcommand | Description |
|---|---|
token |
Get an IMDSv2 session token |
metadata <path> |
Fetch a metadata path (e.g. instance-id, ami-id) |
tag <key> |
Get an instance tag value (no newline; for VAR=$(readimds tag Name)) |
Run with no arguments or --help for the full usage guide.
Examples
# Session token
# Instance ID and AMI
# Instance tag into a variable (no trailing newline)
NAME=
ENV=
Requirements
- Must run on an EC2 instance (IMDS is only available from the instance).
- Instance metadata options: IMDSv2 required (or allow both v1 and v2). Token TTL used is 300 seconds.
License
MIT