# 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:
```bash
backupdirsm --upload /path/to/directory --include ".*/src/.*" --exclude ".*\.log$"
```
### Download Files
Download only *.conf files from the AWS Secrets Manager:
```bash
backupdirsm --download /path/to/directory --include ".*\.conf$"
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ludenus/backupdirsm",
"name": "backupdirsm",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "backup, aws, secrets, secrets-manager, restore",
"author": "Andrey Andreyev",
"author_email": "x0153362@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ee/1e/c26534fd50b0f49c09034b8ac1916b5a2659a65c09cd7053feb4b87588a1/backupdirsm-0.0.8.tar.gz",
"platform": null,
"description": "# backupdirsm\n\nThis 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.\n\n## Features\n\n- **Upload directory**: Uploads all files within a specified directory to AWS Secrets Manager as secrets.\n- **Download directory**: Retrieves and writes secrets from AWS Secrets Manager to a specified directory.\n- **Pattern-based inclusion/exclusion**: Filters files for upload or download based on regular expressions.\n- **Metadata tags**: Attaches tags to each secret, such as the filename, hostname, and last modified timestamp.\n\n## Prerequisites\n\n- **Python 3.6+**: Ensure you have Python installed.\n- **AWS IAM permissions**: Ensure the user has permissions to use AWS Secrets Manager.\n\n## Installation\n```\npip install backupdirsm\n```\n\n\n## Usage\n```\nusage: backupdirsm [-h] [-v] (-u UPLOAD | -d DOWNLOAD) [-i REGEX] [-e REGEX] [-p PREFIX]\n\nUpload or download directory contents to/from AWS Secrets Manager.\n\noptions:\n -h, --help show this help message and exit\n -v, --version show program's version number and exit\n -u UPLOAD, --upload UPLOAD\n Source directory to upload to AWS Secrets Manager\n -d DOWNLOAD, --download DOWNLOAD\n Destination directory where to download from AWS Secrets Manager\n -i REGEX, --include REGEX\n Include only files matching the regex pattern\n -e REGEX, --exclude REGEX\n Exclude files matching the regex pattern\n -p PREFIX, --prefix PREFIX\n Optional prefix to add to the secret name. Must match the pattern /^[a-zA-Z0-9_\\/]*$/\n```\n\n## Examples\n\n### Upload Files\n\nTo upload all src files in a directory to AWS Secrets Manager:\n\n```bash\nbackupdirsm --upload /path/to/directory --include \".*/src/.*\" --exclude \".*\\.log$\"\n```\n\n### Download Files\nDownload only *.conf files from the AWS Secrets Manager:\n```bash\nbackupdirsm --download /path/to/directory --include \".*\\.conf$\"\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": null,
"version": "0.0.8",
"project_urls": {
"Documentation": "https://github.com/ludenus/backupdirsm",
"Homepage": "https://github.com/ludenus/backupdirsm",
"Repository": "https://github.com/ludenus/backupdirsm"
},
"split_keywords": [
"backup",
" aws",
" secrets",
" secrets-manager",
" restore"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "31ab51e621277086fa6d6064d8b4a9c1abade7b885d47d53cccd49fdfb8550c8",
"md5": "820fb9b50ba0f099a60af0c530143bc5",
"sha256": "1bef4cc266149bdb93905997d62a4c7594a3484ebfc32a728ac9f7b2b6f47fdf"
},
"downloads": -1,
"filename": "backupdirsm-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "820fb9b50ba0f099a60af0c530143bc5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 5901,
"upload_time": "2024-11-04T11:49:53",
"upload_time_iso_8601": "2024-11-04T11:49:53.585591Z",
"url": "https://files.pythonhosted.org/packages/31/ab/51e621277086fa6d6064d8b4a9c1abade7b885d47d53cccd49fdfb8550c8/backupdirsm-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ee1ec26534fd50b0f49c09034b8ac1916b5a2659a65c09cd7053feb4b87588a1",
"md5": "9149f0ae5ab97a7ed9c4de783185129a",
"sha256": "b0f330924f6ade4a678722451e6b27c665508307d31db5ab7deddf9266bae3fb"
},
"downloads": -1,
"filename": "backupdirsm-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "9149f0ae5ab97a7ed9c4de783185129a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 5061,
"upload_time": "2024-11-04T11:49:54",
"upload_time_iso_8601": "2024-11-04T11:49:54.817698Z",
"url": "https://files.pythonhosted.org/packages/ee/1e/c26534fd50b0f49c09034b8ac1916b5a2659a65c09cd7053feb4b87588a1/backupdirsm-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-04 11:49:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ludenus",
"github_project": "backupdirsm",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "backupdirsm"
}