Skip to main content

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.

Metadata

Release files for ssmtoenv 0.1.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ssmtoenv 0.1.4.1
File Size Uploaded
ssmtoenv-0.1.4.1.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ssmtoenv 0.1.4.1
File Interpreter ABI Platform
ssmtoenv-0.1.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / ssmtoenv-0.1.4.1.tar.gz

Download URL ssmtoenv-0.1.4.1.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0c2088c67503dc4960927d58409604c2e6e72a20c8ce6d9355fb0165d65680a3
BLAKE2b-256 checksum
How to use checksums
6e3c560154d90288981e9523e1df9ad94b6b4759ff007793767990fcdb275632
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure

Release files / ssmtoenv-0.1.4.1-py3-none-any.whl

Download URL ssmtoenv-0.1.4.1-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfd17aa220efd70d15dd3b9a24d452006d0b38022535abc9cb8d5d9e93e83c5a
BLAKE2b-256 checksum
How to use checksums
6856d22e8e1c76c6959f6608bf7929245d5f184df0319ccf4fb031365f3fe692
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure

Release history Release notifications | RSS feed

This release

0.1.4.1 This release

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page