ec2-meta-env
A simple wrapper script to manifest EC2 instance metadata as environment variables.
Installing ec2-meta-env
Installing ec2-meta-env is as simple as:
pip install ec2-meta-env --upgrade
Using ec2-meta-env
To include EC2 instance meta data in your application’s shell environment, wrap your shell command with the ec2-meta-env script and specify the environment variables you wish to use, e.g.:
ec2-meta-env -e local-ipv4 /path/to/my/app
In the above example, the value of local-ipv4 will be accessible in the shell environment for /path/to/my/app under the variable name EC2_LOCAL_IPV4. Environment variable names are formed by prepending the meta API path with EC2_, uppercasing, and replacing all dashes and forward slashes with underscores.
Other options
A complete list of options can be found by running:
ec2-meta-env --help
Why ec2-meta-env?
EC2 provides instance metadata via http://169.254.169.254/latest/meta-data/. Sometimes it’s easier to use that information if it’s available via environment variables, for example, if your application’s running inside a Docker container on Amazon’s Elastic Container Service (ECS). This project makes it possible to do that without calling the EC2 instance meta data API manually.
Thanks and I hope you find ec2-meta-env helpful!
~Tobias McNulty
Metadata
Release files for ec2-meta-env 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ec2-meta-env-0.1.1.tar.gz | 3.8 kB | Without provenance | Details for ec2-meta-env-0.1.1.tar.gz |
Release files / ec2-meta-env-0.1.1.tar.gz
| Download URL | ec2-meta-env-0.1.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e45cf7cb5055fdb52b3a389270e0ad32ab8679e8f30718231029cb0ba37e13d
|
|
BLAKE2b-256 checksum How to use checksums |
292b911a3cfda5ec81ae5c80fee2a08870c64bde63755b8287180513695b2281
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for ec2-meta-env 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.