Skip to main content

A Python wrapper around the AWS Secrets Manager using Boto3

Project description

CircleCI CircleCI Python 3 Updates GitHub

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.

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.

Filename, size & hash SHA256 hash help File type Python version Upload date
aws_sm-1.0.0-py3-none-any.whl (3.7 kB) Copy SHA256 hash SHA256 Wheel py3
aws-sm-1.0.0.tar.gz (3.1 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page