0.0.8 • Published 8 months ago

env-fetcher-service v0.0.8

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

Env-fetcher-service

This package is used to fetch configuration from AWS Stored Parameters and AWS Secret Manager

Installation

Install env-fetcher-service with npm

  npm i env-fetcher-service

License

MIT

Authors

Usage/Examples

import { App } from 'env-fetcher-service';

export class MainService {
  fetchConfig() {
    const app = new App();
    const options = {
      credentials: {
        region: '<region>',
        credentials: {
          accessKeyId: '<access-key-id>',
          secretAccessKey: '<secret-access-key-id>',
        },
      },
      metadata: {
        secretId: '<secret-ID>', // required for AWS Secret Manager,
        path: '<ssm-path>',  //required for AWS Stored parameter
      },
      enrichmentOptions: {
        enrichResponse: true,
        trimPathVariableName: true,
      },
    };

    const extractorType = 'AWS_SSM' || 'AWS_SECRET_MANAGER';
    const response = app.extractEnv(extractorType, options);
    return response;
  }
}

Tags

0.0.8

8 months ago

0.0.7

8 months ago

0.0.6

10 months ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago