0.2.2 โ€ข Published 8 months ago

envilder v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

image

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 .env file 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

  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=mockedEmail@example.com
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.

0.2.2

8 months ago

0.2.1

8 months ago

0.2.0

8 months ago

0.1.5

9 months ago

0.1.4

9 months ago

0.1.0

9 months ago

1.1.0

9 months ago

1.0.0

9 months ago