Skip to content

πŸš€ Envilder is a CLI tool that quickly converts AWS SSM parameters into .env files, simplifying configuration management for developers.

License

Notifications You must be signed in to change notification settings

macalbert/envilder

Repository files navigation

Envilder

Envilder is a CLI tool for managing AWS SSM Parameter Store parameters and automatically generating the required .env file. This tool simplifies project environment variable management, avoiding manual updates and ensuring consistency across environments.

✨ Features

  • πŸ”’ Fetch parameters securely from AWS SSM Parameter Store.
  • ⚑ Automatically generates a .env file with specified parameters.
  • πŸ›‘οΈ Handles encrypted 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

  1. Install the AWS CLI by following the instructions here.

  2. 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.

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

  1. Create a mapping file param_map.json:

    {
      "SECRET_TOKEN": "/path/to/ssm/token",
      "SECRET_KEY": "/path/to/ssm/password"
    }
  2. Run envilder to generate your .env file:

    envilder --map=param_map.json --envfile=.env
  3. The .env file will be generated in the specified location.

πŸ“‚ Sample .env Output

SECRET_TOKEN[email protected]
SECRET_KEY=mockedPassword

πŸ§ͺ Running Tests

To run the tests with coverage:

yarn test

Here 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.

About

πŸš€ Envilder is a CLI tool that quickly converts AWS SSM parameters into .env files, simplifying configuration management for developers.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published