Skip to main content

A Python wrapper around the AWS Secrets Manager using Boto3

Project description




PyPI - Python Version



A Python wrapper around AWS Secrets Manager using Boto3.


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.

Source Distribution

aws-sm-0.0.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

aws_sm-0.0.1-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page