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.
- 🔒 Fetch parameters securely from AWS SSM Parameter Store.
- ⚡ Automatically generates a
.env
file with specified parameters. - 🛡️ Handles encrypted (currently only supported) SSM parameters.
- 🪶 Lightweight and simple to use.
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.
-
Install the AWS CLI by following the instructions here.
-
After installation, configure the AWS CLI using the following command:
aws configure
You'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.
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
You can install envilder globally or locally using npm:
npm install -g envilder
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.
-
Create a mapping file
param_map.json
:{ "SECRET_TOKEN": "/path/to/ssm/token", "SECRET_KEY": "/path/to/ssm/password" }
-
Run envilder to generate your
.env
file:envilder --map=param_map.json --envfile=.env
-
The
.env
file will be generated in the specified location.
SECRET_TOKEN[email protected]
SECRET_KEY=mockedPassword
To run the tests with coverage:
yarn test
Here you can see the current coverage report: https://macalbert.github.io/envilder/
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Feel free to submit issues and pull requests.