envilder v0.2.2
Envilder is a CLI tool to manage AWS SSM Parameter Store parameters and automatically generate the required .env file. This tool simplifies environment variable management for projects, avoiding manual updates and ensuring consistency across environments.
โจ Features
- ๐ Fetch parameters securely from AWS SSM Parameter Store.
- โก Automatically generates a
.envfile with specified parameters. - ๐ก๏ธ Handles encrypted (currently only supported) SSM parameters.
- ๐ชถ Lightweight and simple to use.
Prerequisites
Before using Envilder, ensure that you have the AWS CLI installed and properly configured on your local machine. This configuration is required for Envilder to access and manage parameters in AWS SSM.
AWS CLI Installation & Configuration
- Install the AWS CLI by following the instructions here.
After installation, configure the AWS CLI using the following command:
aws configureYou'll be prompted to provide:
- AWS Access Key ID
- AWS Secret Access Key
- Default region name (e.g.,
us-east-1) - Default output format (e.g.,
json)
Make sure that the AWS credentials you're using have the appropriate permissions to access the SSM Parameter Store in your AWS account.
Installation
You can install Envilder globally using yarn. This will allow you to use the envilder command from any directory on your system.
yarn global add envilder๐ฆ Installation
You can install envilder globally or locally using npm:
npm install -g envilder๐ Usage
Envilder requires two arguments:
--map <path>: Path to a JSON file mapping environment variable names to SSM parameters.--envfile <path>: Path where the generated .env file will be saved.
๐ง Example
Create a mapping file
param_map.json:{ "SECRET_TOKEN": "/path/to/ssm/token", "SECRET_KEY": "/path/to/ssm/password" }Run envilder to generate your
.envfile:envilder --map=param_map.json --envfile=.envThe
.envfile will be generated in the specified location.
๐ Sample .env Output
SECRET_TOKEN=mockedEmail@example.com
SECRET_KEY=mockedPassword๐งช Running Tests
To run the tests with coverage:
yarn testHere you can see the current coverage report: https://macalbert.github.io/envilder/
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Contributing
Contributions are welcome! Feel free to submit issues and pull requests.