A Python wrapper around the AWS Secrets Manager using Boto3
Project description
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
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
File details
Details for the file aws-sm-1.3.0.tar.gz
.
File metadata
- Download URL: aws-sm-1.3.0.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c847108cca77b97fbcf79a3102cf722f07f62004b545f23dec41d6339e0204c |
|
MD5 | 8a5ecc83828496d826c19e2d64731229 |
|
BLAKE2b-256 | 6321cb8fc19a62c59eb5568b6a187711d8bc729d76589f0abed976bbf30c210d |
File details
Details for the file aws_sm-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: aws_sm-1.3.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f21e14ef56f6a96d0611b71f441c9c859297fb469df7b5cf1a4664f006db5e73 |
|
MD5 | a702f22fd3746212fbfc21397dde89fd |
|
BLAKE2b-256 | 255a264eebc5064a511530292ae0d261f5408c782d12daf13caf590d6c88d3e1 |