Fetch SSM parameters and add them to .env file
Project description
ssmtoenv - SSM Parameter to .env File Utility
ssmtoenv
is a command-line utility that allows you to fetch AWS Systems Manager (SSM) parameters and add them to a .env
file. This tool is designed to simplify the process of retrieving and managing sensitive configuration parameters from AWS SSM Parameter Store and making them available for your applications in a local environment.
Usage
ssmtoenv --aws-access-key <AWS_ACCESS_KEY> --aws-secret-key <AWS_SECRET_KEY> [--session-token <SESSION_TOKEN>] [--prefix <PREFIX>] [--install-completion <SHELL>] [--show-completion <SHELL>] [--help]
Options
--aws-access-key TEXT
: AWS Access Key (required).--aws-secret-key TEXT
: AWS Secret Key (required).--session-token TEXT
: AWS Session Token (optional, defaults to "None").--prefix TEXT
: SSM Parameter Store prefix (optional, defaults to "/cloudflaretunnel/").--install-completion [bash|zsh|fish|powershell|pwsh]
: Install completion for the specified shell.--show-completion [bash|zsh|fish|powershell|pwsh]
: Show completion for the specified shell, to copy it or customize the installation.--help
: Show this message and exit.
How It Works
ssmtoenv
interacts with AWS Systems Manager Parameter Store to retrieve configuration parameters based on the provided options. It then generates or updates a .env
file with the retrieved parameters, making them available for your application to consume.
Installation
You can install ssmtoenv
using pip
, the Python package manager:
pip install ssmtoenv
Example
Suppose you have AWS SSM parameters with the prefix /myapp/
containing database credentials, and you want to add them to a .env
file for your application to use. You can use the following command:
ssmtoenv --aws-access-key <YOUR_AWS_ACCESS_KEY> --aws-secret-key <YOUR_AWS_SECRET_KEY> --prefix /myapp/
This command will fetch all parameters under the /myapp/
prefix and update your .env
file with the retrieved values.
Contributing
If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the GitHub repository.
Note: This README provides a brief overview of the ssmtoenv
utility. For more detailed information, options, and usage examples, please refer to the command-line help (ssmtoenv --help
) or the source code documentation.
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
Built Distribution
File details
Details for the file ssmtoenv-0.1.4.1.tar.gz
.
File metadata
- Download URL: ssmtoenv-0.1.4.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c2088c67503dc4960927d58409604c2e6e72a20c8ce6d9355fb0165d65680a3 |
|
MD5 | b88bac2f2c3050f3fd522b182cb92131 |
|
BLAKE2b-256 | 6e3c560154d90288981e9523e1df9ad94b6b4759ff007793767990fcdb275632 |
File details
Details for the file ssmtoenv-0.1.4.1-py3-none-any.whl
.
File metadata
- Download URL: ssmtoenv-0.1.4.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfd17aa220efd70d15dd3b9a24d452006d0b38022535abc9cb8d5d9e93e83c5a |
|
MD5 | 8c72a331b380ed97a7d25df01db3ae99 |
|
BLAKE2b-256 | 6856d22e8e1c76c6959f6608bf7929245d5f184df0319ccf4fb031365f3fe692 |