Allows querying EC2 instance metadata
Project description
EC2 Instance Metadata
This allows querying EC2 instance metadata.
It uses IMDSv2. Session credentials are NOT available using this.
Installation
Available on Pypi as query-ec2-metadata
pip install query-ec2-metadata
Command line tools
ec2-metadata
Usage:
ec2-metadata KEY
This returns an attribute from the instance metadata.
The KEY can be any of the data values from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html
instance-identity
Usage:
instance-identity KEY
This returns an attribute from the instance identity document.
The key can be any of the data values from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html
Python module
instance_identity_document() -> Dict[str, str]:
This returns the identity document for the instance.
instance_identity(key: str) -> str:
This returns an attribute from the instance identity document.
The key can be any of the data values from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html
ec2_metadata(key: str) -> str:
This returns an attribute from the instance metadata.
The key can be any of the data values from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html
Development
make initto set things upmake pytestto run unit testsmake testto run all tests
Remember to bump the version in pyproject.toml before merging.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file query_ec2_metadata-0.1.3.tar.gz.
File metadata
- Download URL: query_ec2_metadata-0.1.3.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.6.9 Linux/5.4.0-1047-aws
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d85a324ee78bd7fefba63617c11bb7c34aa96da548d6d13541f938deb6d3daf3
|
|
| MD5 |
ee84540ee390985043b5aa12d2bb7f34
|
|
| BLAKE2b-256 |
54b8789c5c7a8fc839131501490046b9edeb7ee715651fb14ba597ba99f04099
|
File details
Details for the file query_ec2_metadata-0.1.3-py3-none-any.whl.
File metadata
- Download URL: query_ec2_metadata-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.6.9 Linux/5.4.0-1047-aws
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71440823935ccc79f422b48459a503a69ded57f9bcea463fa42b7c6f91471bdc
|
|
| MD5 |
374a440a9fff9bffbdc66772e504e687
|
|
| BLAKE2b-256 |
9d46ab638ff50cd08e1c55d39936415cdfd353cdc470f38ab0ad130ca4bb23f1
|