https://github.com/invit/ec2meta
Simple CLI to query AWS EC2 instance metadata.
https://github.com/invit/ec2meta
Last synced: 3 days ago
JSON representation
Simple CLI to query AWS EC2 instance metadata.
- Host: GitHub
- URL: https://github.com/invit/ec2meta
- Owner: invit
- License: mit
- Created: 2020-10-30T22:52:33.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-31T00:09:52.000Z (about 5 years ago)
- Last Synced: 2025-01-19T13:16:15.115Z (12 months ago)
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ec2meta

Simple CLI to query AWS EC2 instance metadata.
## Usage
```
$ ec2meta
Display EC2 instance metadata
Usage:
ec2meta [command]
Available Commands:
get Returns arbitrary metadata by path
help Help about any command
version Print the version number of ec2meta
Flags:
-h, --help help for ec2meta
Use "ec2meta [command] --help" for more information about a command.
```
### Query
```
$ ec2meta help get
Returns arbitrary metadata by path
Usage:
ec2meta get [flags]
Flags:
-h, --help help for get
```
`` can either point to a directory path, like
```
$ ec2meta get /
ami-id
ami-launch-index
ami-manifest-path
block-device-mapping/
events/
hibernation/
hostname
iam/
identity-credentials/
instance-action
instance-id
instance-life-cycle
instance-type
local-hostname
local-ipv4
mac
metrics/
network/
placement/
profile
public-hostname
public-ipv4
reservation-id
security-groups
services/
```
a single element
```
$ ec2meta get /hostname
ip-10-0-0-248.eu-central-1.compute.internal
```
or reference either all `[*]` elements or a specific one (e.g. `[0]`) in a list:
```
$ ec2meta get /network/interfaces/macs/[0]/vpc-id
vpc-XXXXXXXX
```