secret2env
Command-line tool for generating sourcable environment variables from secrets in AWS Secrets Manager using a YAML definition.
Installation
$ pip install secrets2env
Environment Definition
Below is an example environment definition. The values for environment variables will be generated
using .format() and keyword arguments.
- secret: aws/secret-name
name: ENV_SECRET
value: "{key1-in-secret}"
- secret: production/postgresql
name: PSQL_URI
value: "postgresql://{username}:{password}@postgresql:5432/{dbname}"
Usage
Path to a definition like the one can be provided as argument, otherwise it defaults to ./aws-secrets.yml.
Running secrets2env will print a sourceable environment to STDOUT which can be evald or redirected to an environment file.
# with path to definition file
$ secrets2env --definition path/to/definition.yml
# or using the default path (./aws-secrets.yml) with the definition above
$ secrets2env
It will result in the following output
# Autogenerated by <path/to/installed/secrets2env.py>
export ENV_SECRET='some-secret'
export PSQL_URI='postgresql://pg-user:pg-pw@postgresql:5432/pgdb'
# you can eval directly
eval "`secrets2env`"
# or redirect to file
echo -e "\n`secrets2env`" >> env.sh
Limitations / TODOs
- currently only supports
SecretString - currently only supports OsX and Linux
- no automated tests
Metadata
Release files for secrets2env 0.1.4
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 |
|---|---|---|---|---|
| secrets2env-0.1.4.tar.gz | 3.3 kB | Without provenance | Details for secrets2env-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| secrets2env-0.1.4-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for secrets2env-0.1.4-py2.py3-none-any.whl |
Total release size: 7.3 kB
Release files / secrets2env-0.1.4.tar.gz
| Download URL | secrets2env-0.1.4.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c74a8d1b567e63e5bb6134035d191bd2e3ba14189fe76a42c2e8d4a481f7a73
|
|
BLAKE2b-256 checksum How to use checksums |
ce03767ea23794fa91231458ca2123d7572955c16d4fc29a347bfa7abb742d52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / secrets2env-0.1.4-py2.py3-none-any.whl
| Download URL | secrets2env-0.1.4-py2.py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
94520855b6d097c102865e8d202077536281acddd8c5bec47d78c16cf0b04dae
|
|
BLAKE2b-256 checksum How to use checksums |
0d7193e2d0f0b802a986cff6a67f9e8d10d6d843a1a85d357c7bc2215476b71e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for secrets2env 0.1.4
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.