aws-sm
A Python wrapper around AWS Secrets Manager using Boto3.
Installation
Installing from PyPI is as easy as doing:
$ pip install aws-sm
Usage
from aws_sm import SecretsManager
AWS_ACCESS_KEY_ID = ***************
AWS_SECRET_ACCESS_KEY = ***************
secretsmanager = SecretsManager('us-east-1', AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
secrets = secretsmanager.get_secret_values('tutorials/MyFristTutorialSecret')
USER_NAME = secretsmanager.get_secret_value('USER_NAME', secrets)
PASSWORD = secretsmanager.get_secret_value('PASSWORD', secrets)
This is sample code using aws-sm to get USER_NAME and PASSWORD from tutorials/MyFristTutorialSecret.
USER_NAME and PASSWORD are Secret value.
tutorials/MyFristTutorialSecret is Secret name.
This is AWS Console of Secrets Manager.
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are unnecessary when attaching the appropriate IAM Role. The default policy is SecretsManagerReadWrite.
Set Up Loacally
Make sure you have Docker Compose.
$ docker-compose up
Run test
$ docker-compose exec app bash
root@d5d52d6765d9:/app# py.test -v
Release files for aws-sm 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aws-sm-1.3.0.tar.gz | 23.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aws_sm-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.5 kB
Release files / aws-sm-1.3.0.tar.gz
| Download URL | aws-sm-1.3.0.tar.gz |
|---|---|
| Size | 23.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c847108cca77b97fbcf79a3102cf722f07f62004b545f23dec41d6339e0204c
|
|
BLAKE2b-256 checksum How to use checksums |
6321cb8fc19a62c59eb5568b6a187711d8bc729d76589f0abed976bbf30c210d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / aws_sm-1.3.0-py3-none-any.whl
| Download URL | aws_sm-1.3.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f21e14ef56f6a96d0611b71f441c9c859297fb469df7b5cf1a4664f006db5e73
|
|
BLAKE2b-256 checksum How to use checksums |
255a264eebc5064a511530292ae0d261f5408c782d12daf13caf590d6c88d3e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|