Convenience wrapper for AWS Parameter Store/Secrets Manager
Project description
s1crets is a thin Python wrapper to read secrets from cloud resources. Wherever supported, it can be used to read/update non-encrypted values as well.
You can find its documentation at readthedocs.io
Installing
Install and update using pip:
pip install -U s1crets
A Simple Example
# Using AWS Parameter Store
import s1crets.providers.aws
ps = s1crets.providers.aws.ParameterStore()
ps.get('/prod/databases/mysql/bigdb/root')
ps.get_by_path('/prod/databases/mysql')
ps.path_exists('/prod/databases/mysql')
ps.update('/prod/databases/mysql/bigdb/root', 'S3cr3Tp4Ssw0Rd!^')
# AWS Secrets Manager
sm = s1crets.providers.aws.SecretsManager()
sm.get('prod/databases/mysql/bigdb/root')
sm.path_exists('prod/databases/mysql')
sm.update('prod/databases/mysql/bigdb/root', 'S3cr3Tp4Ssw0Rd!^')
$ s1crets get secrets/json_test
{'level1': {'level2': 3}}
$ s1crets get secrets/json_test level1
{'level2': 3}
$ s1crets get secrets/json_test level1 level2
3
Getting secrets from a different (than configured) region:
import s1crets.providers.aws
sm = s1crets.providers.aws.SecretsManager(sts_args={"aws_region": "us-east-1"})
sm.get("secret-from-us-east-1")
This library is developed and used internally at System1
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
s1crets-0.0.10.tar.gz
(9.2 kB
view hashes)
Built Distribution
Close
Hashes for s1crets-0.0.10-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1ebe0f50a17cd06f4c449c916b58a9d56165244f98092d5f781d7f5527b7ed0 |
|
MD5 | a2d83c636be588e726db53db46ea50b0 |
|
BLAKE2b-256 | dc2518c43f096a0f7359a1d6ba10699af3b78a794829ba18b2eb10cad431fbc5 |