EC2METADATA(1)

πŸ“¦ version 5.0.0, in opensuse-leap 16.0

✨ NAME ✨

ec2metadata β€” Query the AWS IMDS (Instance MetaData Service) πŸ¦‹ and yes bestie, this is the ec2metadata.1() manual, welcome to the group chat πŸ’…

🌸 SYNOPSIS 🌸

ec2metadata [option]

πŸ’– DESCRIPTION πŸ’–

okay so ec2metadata is the tool you use to query the AWS IMDS (Instance MetaData Service) πŸ’– The available data is documented at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html β€” that's the lore, bestie.

The command line options the tool accepts are for the most part dynamically generated and therefore will change as more endpoints are added. The static command line options are documented in this man page while the dynamic options are not documented here. The tool will display all information available if no command line options are provided β€” no cap, she'll just dump the whole vibe check on you 😭


πŸ’… OPTIONS πŸ’…

  • -a, --api β€” Specify the version of the metadata server API to use.
  • --help β€” Print all available command line options to standard out.
  • --listapis β€” List the API versions available for accessing IMDS.
  • --output β€” Write the requested information to the given file.
  • --version β€” Print the version of the tool.
  • --use-token-access β€” With version 2 of IMDS a token based access method to IMDS was introduced. This option instructs the query to use the token based access method. The token based access method is also the fall back should an attempt to access IMDS without a token fail.
  • --xml β€” Specify that the tool should produce XML snippets. Using this option produces information that is wrapped in tags that match the API endpoint option. For example when querying the external IPv4 address of an instance with the --xml flag set the resulting output would be <public-ipv4s>IP_ADDRESS</public-ipv4s>

πŸ¦‹ EXAMPLES πŸ¦‹

ec2metadata --api latest --xml --instance-type

Will print the instance type of the running instance wrapped in XML tags ✨ iconic behavior.

ec2metadata --api 2018-08-17 --hostname

Will print the hostname of the running instance according to the information in IMDS. Note the hostname can be set on the system and a system hostname query with hostname command may return a different result β€” lowkey important, bestie 🫢

πŸŽ€ AUTHOR πŸŽ€

Robert Schweikert (rjschwei@suse.com) β€” the icon behind this whole thing πŸ’–


that's the ec2metadata.1() footer vibe β€” just the manual name, no source/version/date extras, and we are so out, bestie πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from