backupdirsm
This Python script uploads or downloads the contents of a specified directory to/from AWS Secrets Manager. It provides a secure way to store or retrieve sensitive data from a directory using AWS Secrets Manager.
Features
- Upload directory: Uploads all files within a specified directory to AWS Secrets Manager as secrets.
- Download directory: Retrieves and writes secrets from AWS Secrets Manager to a specified directory.
- Pattern-based inclusion/exclusion: Filters files for upload or download based on regular expressions.
- Metadata tags: Attaches tags to each secret, such as the filename, hostname, and last modified timestamp.
Prerequisites
- Python 3.6+: Ensure you have Python installed.
- AWS IAM permissions: Ensure the user has permissions to use AWS Secrets Manager.
Installation
pip install backupdirsm
Usage
usage: backupdirsm [-h] [-v] (-u UPLOAD | -d DOWNLOAD) [-i REGEX] [-e REGEX] [-p PREFIX]
Upload or download directory contents to/from AWS Secrets Manager.
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-u UPLOAD, --upload UPLOAD
Source directory to upload to AWS Secrets Manager
-d DOWNLOAD, --download DOWNLOAD
Destination directory where to download from AWS Secrets Manager
-i REGEX, --include REGEX
Include only files matching the regex pattern
-e REGEX, --exclude REGEX
Exclude files matching the regex pattern
-p PREFIX, --prefix PREFIX
Optional prefix to add to the secret name. Must match the pattern /^[a-zA-Z0-9_\/]*$/
Examples
Upload Files
To upload all src files in a directory to AWS Secrets Manager:
backupdirsm --upload /path/to/directory --include ".*/src/.*" --exclude ".*\.log$"
Download Files
Download only *.conf files from the AWS Secrets Manager:
backupdirsm --download /path/to/directory --include ".*\.conf$"
Metadata
Release files for backupdirsm 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| backupdirsm-0.0.8.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| backupdirsm-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.0 kB
Release files / backupdirsm-0.0.8.tar.gz
| Download URL | backupdirsm-0.0.8.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0f330924f6ade4a678722451e6b27c665508307d31db5ab7deddf9266bae3fb
|
|
BLAKE2b-256 checksum How to use checksums |
ee1ec26534fd50b0f49c09034b8ac1916b5a2659a65c09cd7053feb4b87588a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
|
Release files / backupdirsm-0.0.8-py3-none-any.whl
| Download URL | backupdirsm-0.0.8-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1bef4cc266149bdb93905997d62a4c7594a3484ebfc32a728ac9f7b2b6f47fdf
|
|
BLAKE2b-256 checksum How to use checksums |
31ab51e621277086fa6d6064d8b4a9c1abade7b885d47d53cccd49fdfb8550c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure
|