Metadata-Version: 2.1
Name: aws-sm
Version: 0.0.1
Summary: A Python wrapper around the AWS Secrets Manager using Boto3
Home-page: https://github.com/jumpyoshim/aws-sm
Author: jumpyoshim
Author-email: jumpyoshim@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.5
Description-Content-Type: text/markdown
Requires-Dist: boto3 (==1.9.*)

[![CircleCI](https://circleci.com/gh/jumpyoshim/aws-sm.svg?style=svg)](https://circleci.com/gh/jumpyoshim/aws-sm)

[![CircleCI](https://img.shields.io/badge/coverage-95%25-green.svg)](https://circleci.com/gh/jumpyoshim/aws-sm)

[![PyPI](https://img.shields.io/badge/pypi-v0.0.1-blue.svg)]()


[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/Django.svg)]()


[
![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)
](https://opensource.org/licenses/MIT)


# aws-sm
A Python wrapper around [AWS Secrets Manager](https://aws.amazon.com/jp/secrets-manager/) using Boto3.


# Usage

```python
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`.

<img width="990" alt="0030-09-25 22 32 21" src="https://user-images.githubusercontent.com/24784855/46020218-d4e5b580-c118-11e8-9aa7-69edbecb8de2.png">

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](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_identity-based-policies.html).


# Set Up Loacally

Make sure you have [Docker Compose](https://docs.docker.com/compose/install/).

```sh
$ docker-compose up
```

## Run test

```sh
$ docker-compose exec app bash
root@d5d52d6765d9:/app# py.test -v
```


