Skip to main content

A Python wrapper around the AWS Secrets Manager using Boto3

Project description

CircleCI CircleCI GitHub Downloads


A Python wrapper around AWS Secrets Manager using Boto3.


Installing from PyPI is as easy as doing:

$ pip install aws-sm


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.

0030-09-25 22 32 21

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aws-sm, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size aws_sm-1.1.0-py3-none-any.whl (4.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size aws-sm-1.1.0.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page