aws-sm-1.2.0
توضیحات
A Python wrapper around the AWS Secrets Manager using Boto3
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | aws-sm-1.2.0 |
| نام | aws-sm |
| نسخه کتابخانه | 1.2.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | saka2jp |
| ایمیل نویسنده | Jumpei Sakatsu <saka2jp@gmail.com> |
| آدرس صفحه اصلی | https://github.com/saka2jp/aws-sm |
| آدرس اینترنتی | https://pypi.org/project/aws-sm/ |
| مجوز | MIT License Copyright (c) 2023 Jumpei Sakatsu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
[](https://github.com/saka2jp/aws-sm/actions/workflows/test.yml) [](https://opensource.org/licenses/MIT) [](https://pepy.tech/project/aws-sm)
# aws-sm
A Python wrapper around [AWS Secrets Manager](https://aws.amazon.com/jp/secrets-manager/) using Boto3.
# Installation
Installing from PyPI is as easy as doing:
```sh
$ pip install aws-sm
```
# 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
```
نیازمندی
| مقدار | نام |
|---|---|
| ~=1.16 | boto3 |
| - | pytest |
| - | flake8 |
| - | flake8-isort |
| - | flake8-polyfill |
| - | radon |
| - | twine |
| - | pytest-mock |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl aws-sm-1.2.0:
pip install aws-sm-1.2.0.whl
نصب پکیج tar.gz aws-sm-1.2.0:
pip install aws-sm-1.2.0.tar.gz