🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

aws-app-config-to-env

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-app-config-to-env

This Node.js module provides a function that allows you to fetch the latest configuration from AWS AppConfig and store it in a .env file.

1.0.1
latest
Version published
Weekly downloads
35
-68.75%
Maintainers
1
Weekly downloads
 
Created

AWS AppConfig to .env converter

This Node.js module provides a function that allows you to fetch the latest configuration from AWS AppConfig and store it in a .env file.

Installation

To install the module, run the following command:

npm install aws-app-config-to-env

Or, if you prefer Yarn:

yarn add aws-app-config-to-env

Usage

import setConfigurationToEnv from 'aws-app-config-to-env';

await setConfigurationToEnv({
  applicationIdentifier: 'my-app',
  environmentIdentifier: 'dev',
  profileIdentifier: 'my-profile',
  envPath: '.env',
});

The setConfigurationToEnv() function takes an object with the following properties:

applicationIdentifier: The ID of the AppConfig application that contains the configuration you want to fetch. environmentIdentifier: The ID of the AppConfig environment that contains the configuration you want to fetch. profileIdentifier: The ID of the AppConfig configuration profile that contains the configuration you want to fetch. envPath: The path where the .env file should be created.

When you call setConfigurationToEnv(), it will fetch the latest configuration from AWS AppConfig using the GetLatestConfigurationCommand() method. The configuration will be parsed from YAML format to a string of key-value pairs, which will then be written to a .env file at the specified envPath.

Requirements

  • Node.js v10.x or later
  • @aws-sdk/client-appconfigdata package
  • yaml package

FAQs

Package last updated on 03 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts